2016-12-13 20 views
6

目前我正在試圖從統一構建一個iOS應用,但保持運行到這4個誤區:團結Xcode項目PlayerSettings_GetBundleIdentifier

Undefined symbols for architecture arm64: 
"_utilityBundleIdentifier", referenced from: 
     _NativeBinding_utilityBundleIdentifier_m3566456099 in Bulk_Assembly-CSharp-firstpass_4.o 
     _NativeBinding_GetBundleIdentifier_m2869188113 in Bulk_Assembly-CSharp-firstpass_4.o 
     _PlayerSettings_GetBundleIdentifier_m1189967083 in Bulk_Assembly-CSharp-firstpass_4.o 
    (maybe you meant: _NativeBinding_utilityBundleIdentifier_m3566456099) 
    "_utilityBundleVersion", referenced from: 
     _NativeBinding_utilityBundleVersion_m3211654534 in Bulk_Assembly-CSharp-firstpass_4.o 
     _NativeBinding_GetBundleVersion_m3758909934 in Bulk_Assembly-CSharp-firstpass_4.o 
     _PlayerSettings_GetBundleVersion_m1248687572 in Bulk_Assembly-CSharp-firstpass_4.o 
    (maybe you meant: _NativeBinding_utilityBundleVersion_m3211654534) 
    "_debugProLogMessage", referenced from: 
     _NativeBinding_debugProLogMessage_m135661794 in Bulk_Assembly-CSharp-firstpass_2.o 
    (maybe you meant: _NativeBinding_debugProLogMessage_m135661794) 
ld: symbol(s) not found for architecture arm64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

退出代碼1 - 適用於建築arm64未定義的符號通常指向的是不是招「的框架被包括在內,但這些引用指向PlayerSettings_GetBundleIdentifier,就我可以告訴Unity屬性而言。

此外,當束標識符,版本&建立在XCode中設置:

Xcode Bundle Identfier

這些都是其他連接標誌 Other Linker Flags

這個錯誤是什麼意思?我忘了包含一個框架,以及Unity或XCode設置中哪一個或哪個出了問題?

回答

1

發生此問題的原因是VoxelBusters中引用的3種方法在隨插件提供的任何.h & .m文件中不存在。使用__Internal DLLImport將方法鏈接到Objective-C代碼。

[DllImport("__Internal")] 
private static extern string utilityBundleVersion(); 
[DllImport("__Internal")] 
private static extern string utilityBundleIdentifier(); 
[DllImport("__Internal")] 
public static extern void debugProLogMessage (string _message, eConsoleLogType _type, string _stackTrace); 

沒有在Xcode項目存在。當我將這些方法添加到來自Unity的AppDelegate.h & AppDelegate.m中時,錯誤消失了,現在我可以繼續工作。