简体   繁体   中英

Unable to build Xcode Project: clang error: linker command failed

I have a Unity project which I have successfully built for Android without issue. When trying to build for iOS I am encountering an issue once the project is in Xcode.

Unity compiles without any errors and creates an Xcode project.

Upon opening the Xcode project I have NO simulators available. I can get these simulators by selecting ios in the Supported Platforms section, at which point simulators become available - originally Supported Platforms is set to iphoneos . This seems extremely odd behaviour to me, and suggests something larger going wrong.

After getting a simulator to select I get the following error when trying to compile/run/build:

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The full error is available on Pastebin (too large to post directly on here):

https://pastebin.com/3fYR8fE3

I'm really at a loss on what I can do. I have tried a number of things, including:

  • Building from Unity as Debug and Release
  • Building from Unity with 'Symlink Unity Libraries' on and off
  • Building from Unity with .Net 3.5 and .Net 4.* flavours
  • Manually adding the libiconv.2.dylib file in the linked frameworks tab as the .tbd equivalent
  • Setting the target minimum version of iOS to 9.0 (negates the need for libiconv.2.dylib entirely)

I am using latest versions of everything:

  • Unity 2018.2.17f1
  • Xcode 10.1

It seems like you have the library il2cpp built for another architecture, have you tried to change your target's "Build Settings > Build Active Architectures Only" to "No"? However I made some researches and it seems that Unity for iPhone doesn't deploy on simulator. It only works on device or in the Unity editor. Check this link out

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM