简体   繁体   English

Unity 3D iOS游戏构建失败Xcode 8.32:“clang错误链接器命令失败,退出代码为1”

[英]Unity 3D iOS Game Build Fail Xcode 8.32: “clang error linker command failed with exit code 1”

Details: 细节:

  • Unity: 5.6.0f3 Unity:5.6.0f3
  • Xcode: Version 8.3.2 (8E2002) Xcode:版本8.3.2(8E2002)
  • Build: Virtual Reality iOS Mobile Game (the only thing I changed in build settings was the color profile from gamma to linear...) 构建:虚拟现实iOS手机游戏(我在构建设置中唯一改变的是从伽玛到线性的颜色配置文件......)

I'm a beginner at Unity 3D and want to test build my game on iOS through Xcode. 我是Unity 3D的初学者,想要通过Xcode在iOS上测试构建我的游戏。 However, I have tried many times and this error consistently pops up. 但是,我已经尝试了很多次,并且这个错误不断出现。

Apple Mach-O Linker (ld) Error Group clang: error: linker command failed with exit code 1 (use -v to see invocation) Apple Mach-O链接器(ld)错误组clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

ld: 1446 duplicate symbols for architecture armv7 ld:1446个用于体系结构armv7的重复符号

Ld /Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Products/Release-iphoneos/test.app/test normal armv7
cd "/Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test"
export IPHONEOS_DEPLOYMENT_TARGET=9.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -L/Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Products/Release-iphoneos -L/Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Products/Release-iphoneos/GTMSessionFetcher -L/Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Products/Release-iphoneos/GoogleToolboxForMac -L/Users/Jolly/Documents/SCHOOL\ STUFF/RMIT/Year\ 2/VR\ story/Builds/0.3\ alpha\ test/Pods/GVRSDK/Libraries -L/Users/Jolly/Documents/SCHOOL\ STUFF/RMIT/Year\ 2/VR\ story/Builds/0.3\ alpha\ test -L/Users/Jolly/Documents/SCHOOL\ STUFF/RMIT/Year\ 2/VR\ story/Builds/0.3\ alpha\ test/Libraries -L/Users/Jolly/Documents/SCHOOL\ STUFF/RMIT/Year\ 2/VR\ story/Builds/0.3\ alpha\ test/Libraries/Plugins/iOS -F/Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Products/Release-iphoneos -filelist /Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/test.LinkFileList -Xlinker -map -Xlinker /Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/test-LinkMap-normal-armv7.txt -miphoneos-version-min=9.2 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/test_lto.o -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -ObjC -lGTMSessionFetcher -lGVRSDK -lGoogleToolboxForMac -lc++ -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework CoreText -framework CoreVideo -framework GLKit -framework MediaPlayer -framework OpenGLES -framework QuartzCore -framework Security -weak_framework CoreMotion -weak-lSystem -ObjC -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 -lgvrunity -weak_framework Metal -weak_framework Security -lPods-Unity-iPhone -framework GLKit -Xlinker -dependency_info -Xlinker /Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/test_dependency_info.dat -o /Users/Jolly/Library/Developer/Xcode/DerivedData/Unity-iPhone-aqqtjpzyrdxrdefeowhehdcbavdc/Build/Products/Release-iphoneos/test.app/test

There's too much to show so I will just show a snippet of the repeating code: 有太多要显示所以我只会显示重复代码的片段:

duplicate symbol _OBJC_CLASS_$_GVRAppearanceConfigurationUtils in:
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Pods/GVRSDK/Libraries/libGVRSDK.a(GVRAppearanceConfigurationUtils_473839876bdc9859610fc4ebacde705c.o)
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/Plugins/iOS/libgvrunity.a(GVRAppearanceConfigurationUtils_473839876bdc9859610fc4ebacde705c.o)
duplicate symbol _OBJC_METACLASS_$_GVRAppearanceConfigurationUtils in:
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Pods/GVRSDK/Libraries/libGVRSDK.a(GVRAppearanceConfigurationUtils_473839876bdc9859610fc4ebacde705c.o)
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/Plugins/iOS/libgvrunity.a(GVRAppearanceConfigurationUtils_473839876bdc9859610fc4ebacde705c.o)
duplicate symbol _OBJC_IVAR_$_GVRAudioEngine._engine in:
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Pods/GVRSDK/Libraries/libGVRSDK.a(GVRAudioEngine_91e63440cd39d6269dadebd554789f11.o)
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/Plugins/iOS/libgvrunity.a(GVRAudioEngine_91e63440cd39d6269dadebd554789f11.o)
duplicate symbol _OBJC_CLASS_$_GVRAudioEngine in:
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Pods/GVRSDK/Libraries/libGVRSDK.a(GVRAudioEngine_91e63440cd39d6269dadebd554789f11.o)
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/Plugins/iOS/libgvrunity.a(GVRAudioEngine_91e63440cd39d6269dadebd554789f11.o)
duplicate symbol _OBJC_METACLASS_$_GVRAudioEngine in:
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Pods/GVRSDK/Libraries/libGVRSDK.a(GVRAudioEngine_91e63440cd39d6269dadebd554789f11.o)
    /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/Plugins/iOS/libgvrunity.a(GVRAudioEngine_91e63440cd39d6269dadebd554789f11.o)
etc... (1400 more lines)

UPDATE: I deleted "arm64" in Build Setting > Architectures, and the warning stopped appearing, but error still occurs 更新:我在Build Setting> Architectures中删除了“arm64”,警告停止显示,但仍然出现错误

warning: arm64 function not 4-byte aligned: ltmp0 from /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/libiPhone-lib.a(unwind_test_arm64.o) ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/Jolly/Documents/SCHOOL STUFF/RMIT/Year 2/VR story/Builds/0.3 alpha test/Libraries/libiPhone-lib.a(unwind_test_arm64.o) 警告:arm64函数不是4字节对齐:ltmp0 from / Users / Jolly / Documents / SCHOOL STUFF / RMIT / Year 2 / VR story / Builds / 0.3 alpha test / Libraries / libiPhone-lib.a(unwind_test_arm64.o)ld:警告:arm64函数不是4字节对齐:_unwind_tester来自/ Users / Jolly / Documents / SCHOOL STUFF / RMIT / Year 2 / VR story / Builds / 0.3 alpha test / Libraries / libiPhone-lib.a(unwind_test_arm64.o)

\n

Here are the errors that popped up: screenshot of errors 以下是弹出的错误错误的屏幕截图
I don't know what's going on :/ But help is greatly appreciated :D 我不知道发生了什么:/但非常感谢帮助:D

Kudos to Phillip Mills for finding a link to the solution! 感谢Phillip Mills寻找解决方案的链接!

Quoting from the website, 引自网站,

  1. Copy the GVROverlayView.h file from Pods/Headers/Public/GVRSDK folder to the top-level Classes folder.Open the main .xcodeproj file. 将GVROverlayView.h文件从Pods / Headers / Public / GVRSDK文件夹复制到顶级Classes文件夹。打开主.xcodeproj文件。
  2. Delete the libPods-Unity-iPhone.a file from the left pane. 从左窗格中删除libPods-Unity-iPhone.a文件。
  3. Under Build Settings, double-click the first line in Other Linker Flags. 在“构建设置”下,双击“其他链接器标志”中的第一行。 Screenshot Photo 截图照片
  4. Delete the $(inherited) line. 删除$(继承)行。
  5. Build the project. 建立项目。
  6. Profit. 利润。

Credits to: https://github.com/googlevr/gvr-ios-sdk/issues/234 致记自: https//github.com/googlevr/gvr-ios-sdk/issues/234

I've also added comment to https://github.com/googlevr/gvr-ios-sdk/issues/234 linked above. 我还在上面链接的https://github.com/googlevr/gvr-ios-sdk/issues/234上添加了评论。 I'll duplicate here.... 我会在这里复制....

The above described issue is actually a different issue than #259 , resulting from upgrading the GoogleVR unity package, without deleting all references to the old libgvrunity.a. 上述问题实际上是一个与#259不同的问题,因为升级了GoogleVR统一包,而没有删除对旧libgvrunity.a的所有引用。

If libGVRSDK.a and libgvrunity.a are creating a mass of conflicting symbols, you need to reimport the GoogleVRForUnity.unitypackage. 如果libGVRSDK.a和libgvrunity.a正在创建大量冲突符号,则需要重新导入GoogleVRForUnity.unitypackage。 But first you need to go through your Assets/Plugins dir and delete any references to GVR, including libgvrunity.a. 但首先你需要浏览你的Assets / Plugins目录并删除对GVR的任何引用,包括libgvrunity.a。 Unity's package manager does not delete files from previously imported packages that conflict with package updates. Unity的包管理器不会从以前导入的包中删除与包更新冲突的文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Unity,Xcode和Clang:错误:链接器命令失败,退出代码为1 - Unity, Xcode and clang: error: linker command failed with exit code 1 Unity3d 2019.3.0f1 with Xcode 10.1 - Got Build time error - clang: error: linker command failed with exit code 1(使用 -v 查看调用) - Unity3d 2019.3.0f1 with Xcode 10.1 - Got Build time error - clang: error: linker command failed with exit code 1 (use -v to see invocation) 铛:错误:链接器命令失败,退出代码为1,Xcode链接器错误 - clang: error: linker command failed with exit code 1, Xcode Linker Error Xcode clang:错误:链接器命令失败,退出代码为 1(UNITY 用于创建) - Xcode clang: error: linker command failed with exit code 1 (UNITY used for creation) 铛:错误:链接器命令失败,退出代码为1(Unity中的XMPP库已导出xcode - clang: error: linker command failed with exit code 1 (XMPP library in Unity exported xcode 铛:错误:链接器命令失败,退出代码为1 iOS9 - clang: error: linker command failed with exit code 1 iOS9 React Native IOS build clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - React Native IOS build clang: error: linker command failed with exit code 1 (use -v to see invocation) 链接器命令失败,退出代码1 clang:错误 - linker command failed with exit code 1 clang:error xcode ios build linker命令失败,退出代码 - xcode ios build linker command failed with exit code Xcode构建错误链接器命令失败,退出代码为1 - Xcode build error linker command failed with exit code 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM