ios - 如何解决 Xcode 10 beta 中的错误 "linker command failed with exit code 1 (use -v to see invocation) "?

标签 ios xcode unity-game-engine

构建时失败。错误提示“/clang:-1: 链接器命令失败,退出代码 1(使用 -v 查看调用)”。我在项目中添加了一个插件unity。是否与插件有关。我考虑过这个 Link寻求解决方案。在这里我找不到任何名为 Pods 的东西。使用 Unity2018.2.1f1 和 Xcode 10 beta。我将在下面附上我在 Xcode 中的项目 View 的图像。 enter image description here Issue Navigator

Ld /Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Products/ReleaseForRunning-iphoneos/BLEDevice.app/BLEDevice normal arm64 (in target: Unity-iPhone)
cd /Users/ar/Desktop/Mobile\ builds/BLEplugin
export IPHONEOS_DEPLOYMENT_TARGET=11.3
/Users/ar/Documents/Xcode10_beta/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Users/ar/Documents/Xcode10_beta/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk -L/Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Products/ReleaseForRunning-iphoneos -L/Users/ar/Desktop/Mobile\ builds/BLEplugin -L/Users/ar/Desktop/Mobile\ builds/BLEplugin/Libraries -F/Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/BLEDevice.LinkFileList -Xlinker -map -Xlinker /Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/BLEDevice-LinkMap-normal-arm64.txt -miphoneos-version-min=11.3 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/BLEDevice_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -framework Security -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -weak_framework Metal -Xlinker -dependency_info -Xlinker /Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/BLEDevice_dependency_info.dat -o /Users/ar/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwrscueopskznmbrdgdlaztrxbdz/Build/Products/ReleaseForRunning-iphoneos/BLEDevice.app/BLEDevice

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CBMutableService", referenced from:
      objc-class-ref in UnityBluetoothLE.o
  "_OBJC_CLASS_$_CBMutableCharacteristic", referenced from:
      objc-class-ref in UnityBluetoothLE.o
  "_CBAdvertisementDataManufacturerDataKey", referenced from:
      -[UnityBluetoothLE centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in UnityBluetoothLE.o
  "_CBAdvertisementDataServiceUUIDsKey", referenced from:
      -[UnityBluetoothLE startAdvertising] in UnityBluetoothLE.o
  "_OBJC_CLASS_$_CBUUID", referenced from:
      objc-class-ref in UnityBluetoothLE.o
  "_CBAdvertisementDataLocalNameKey", referenced from:
      -[UnityBluetoothLE startAdvertising] in UnityBluetoothLE.o
      -[UnityBluetoothLE centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in UnityBluetoothLE.o
  "_OBJC_CLASS_$_CBPeripheralManager", referenced from:
      objc-class-ref in UnityBluetoothLE.o
  "_OBJC_CLASS_$_CBCentralManager", referenced from:
      objc-class-ref in UnityBluetoothLE.o
  "_CBCentralManagerScanOptionAllowDuplicatesKey", referenced from:
      __iOSBluetoothLEScanForPeripheralsWithServices in UnityBluetoothLE.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

我从未使用过 Unity,但您的错误明确指出您的 Unity 蓝牙 LE 库中的几个符号未针对平台 arm64 定义。这意味着它不包含 arm64 的正确机器代码,这是 iPhone 使用的平台。这意味着您需要用另一个库替换库。我在 Unity Asset Store 中找到了几个蓝牙文件库。祝你使用其中任何一个好运。

关于ios - 如何解决 Xcode 10 beta 中的错误 "linker command failed with exit code 1 (use -v to see invocation) "?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51629954/

相关文章:

ios - UIWebView 滚动到顶部时显示空白

iphone - App Store 中的 iPhone 应用程序真的可以接受 Flash 5.5 和 Flex 4.5 吗?

ios - 如何在iOS应用程序中添加Unity 3d的unity View?

ios - 如何动画进度 View ?

ios - 测试 iOS 应用的 iAd 归因

ios - 使用 Objective-C 将 XMP 数据嵌入到 PNG

ios - 从更新调用时 GLKTextureLoader 失败

xcode - 如何使用 xcode 3.2.5 将应用程序提交到 mac 应用程序商店

iOS 原生项目集成 Vuforia Unity 项目

c# - 一旦 ARCore 在 Unity 应用程序中加载,文本就会消失