Xcode 7 Beta 6, dyld ___NSArray0__ crash

假如想象 提交于 2019-11-27 05:50:11

问题


For the first time I was able to compile my app in Xcode 7 (failed in beta 4 and 5). So, thats good progress I guess.

However, when i load my app on my iPhone 6, iOS 8.4.1, it crashed in the debugger with the following message:

dyld: Symbol not found: _NSArray0 Referenced from: /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq

Is this something to do with the order of the libraries being linked? Look forward to some advise.

Thanks!


回答1:


I experienced the same exact crash running Xcode 7.0 beta 6 on a device with the first iOS 9 beta installed, the crash however was not occurring while using the simulator.

After updating my iPhone to iOS 9 beta 5, the crash stopped.




回答2:


I fixed it by putting this in the podfile. platform :ios, '8.4' No need to update your device to iOS 9 and lose out on 8.4 testing.




回答3:


I had the same error and I fixed. I removed CoreFoundation.framework and Add again with Status "Optional" and works.




回答4:


If anybody else got this while running unit tests do the following:

  1. Select unit tests target
  2. Go to Build Settings
  3. Search for 'Deployment Target'
  4. Change Deployment Target version to your project's deployment target

That's it!




回答5:


I also had this problem and I fixed it by adding framework CoreFoundation.framework to Build Settings.




回答6:


This as a problem on iOS8 build with the new XCODE release, Please remove CoreFoundation.framework and Add it again with Status of "Optional".




回答7:


I used to have the same error during compilation of a mac os project after updating the Xcode for 7.0 GM version (7A218). Xcode 7 has the 10.11 sdk in it only (you could check that in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, where it's a MacOSX10.11.sdk).

At compilation time the xcode will link the frameworks from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks, but at runtime from /System/Library/Frameworks/ as I guess.

I have OS X 10.10.5 (14F27) on mac. Either I have my static library that I've built by xcode 7 (MacOSX10.11.sdk as you remember from earlier), which I've linked to my project after. After running I got the runtime error as

dyld: Symbol not found: _NSArray0

I think it's because the library has been compiled with CoreFoundation.framework from mac os sdk 10.11, but at runtime was linked to CoreFoundation.framework from /System/Library/Frameworks/ where version of which is 10.10 (as OS version).

How I fixed this. Friend of mine has xcode 6 yet, I took mac os sdk 10.10 from there (as you remember in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, name is MacOSX10.10.sdk) and added it to Xcode of mine. Then I rebuilt my static library with 10.10 sdk (you could compile from cli with '-sdk macosx10.10' parameter or set build sdk in Build Settings => Base SDK). After the problem has been solved.

I assume that for the iOS you could apply the same strategy.



来源:https://stackoverflow.com/questions/32211894/xcode-7-beta-6-dyld-nsarray0-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!