I am trying to build and run my unity application in my iOS device for debugging purpose. I get a build file from Unity. Then I open .xcodeproj file in my xcode 14. When I run the app, it gives this error:
When I google it, I find out that Xcode 14 does not support this architecture anymore:
So I cannot debug my unity app in my iOS device. You may say that okay use older version of Xcode like 13, however xcode 13 does not support iOS 16 or later (my device has iOS 16). I am little bit stuck in there. How can I get rid of this situation? Is there any way to change the armv7 architecture that is created by unity build file?
I tried to solve armv7 error but I could not. Is there any way to handle this problem with unity and Xcode 14 environments?
I ran into this as well and don't see a solution with Xcode 14. I may have to investigate how to revert to Xcode 13 as I don't think I use any advanced iOS features and have older devices to test on.
Related
Our app uses CoreNFC to scan NFC tags or you can use QR if NFC is not supported. This worked pretty well and we were able to run the app in the simulator for (ui) testing purposes.
Until Xcode12 / iOS14 GM builds. In iOS13 (or lower) we wouldn't have any issues running it on a simulator.
But in Xcode12 running it on a iOS14 simulator iPhone11 we would get the following:
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/xxx/Library/Developer/CoreSimulator/Caches/dyld/19G73/com.apple.CoreSimulator.SimRuntime.iOS-14-0.18A372
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-awnlestrbvesqqbynrhmluzhbcsc/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSi
dyld: Library not loaded: /usr/lib/libnfshared.dylib
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreNFC.framework/CoreNFC
Reason: no suitable image found. Did find:
/usr/lib/libnfshared.dylib: mach-o, but not built for platform iOS-sim
That the simulator crashes makes sense to me, since the simulator can't scan NFC tags, but this is what I've done:
I already linked to the CoreNFC framework and made it optional, like described here: Xcode 10, Swift 4 app with CoreNFC crashes in review on iOS 12
Put #if canImport(CoreNFC) around import CoreNFC and it's underlying NFC code.
Cleaning the build folder and deleting derived data.
Created an empty Xcode12 project: https://github.com/basvankuijck/CoreNFCCrashProject, same result.
Removed all the listed simulators and re-added one
Added -weak_framework "CoreNFC" to the Other Linker Flags build setting
Obviously removing any references to the CoreNFC framework by either commenting out code sections and removing the framework link, makes the crash disappear. But that's not a suitable option.
Running it from Xcode12 on an iOS13 simulator 'device' works perfectly. So I can't seem to figure out what is causing this behavior
Apple obviously forgot to add libnfshared.dylib for whatever reason in the final version of Xcode 12 for iOS 14 simulators. A working workaround until Apple fixes this is to copy the missing lib from Xcode 12 beta 6 over (download the beta from Apple's developer download section). The missing lib can be found here and must go into the same directory for final Xcode 12
This works for me. 💯
If you want to avoid the hassle of downloading 11.25GB Xcode 12.2 beta for a single file. I have the file to share.
You may execute the following command to download and place it inside the Xcode package:
sudo curl https://storage.googleapis.com/mobile-simulator-build/libnfshared.dylib -o /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnfshared.dylib
Hope it helps 😉
Apple obviously forgot to add libnfshared.dylib for whatever reason in the final version of Xcode 12 for iOS 14 simulators. A working workaround until Apple fixes this is to copy the missing lib from Xcode 12 beta 6 over (download the beta from Apple's developer download section). The missing lib can be found here and must go into the same directory for final Xcode 12:
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
Linker says that the file libnfshared (mach-o) doesn't include the binary for a simulator, which is strange because it's Apple core framework.
Create a new project with Xcode 12 and import the NFC framework. Build it and run it on a simulator. If it doesn't crash then compare the build settings specially for DYLD between those projects.
If this doesn't help, delete all the simulators and recreate new ones.
Updated:
It's bug in IOS 14 and someone has submitted a radar: openradar.appspot.com/FB8699389
A bit in later, but maybe useful for others...
scenario:
App must use NFC (where available)
Must work also on pre-NFC device (i.es. iPhone 6 with iOS12)
Build for iOS12
Some "good to use" technics:
#if canImport(CoreNFC)
import CoreNFC
...
instead of old:
#available(iOS 11.0, *) .. and similar..
Notes:
"canImport" works at compile time, so if You want to solve:
"dyld: Library not loaded: /System/Library/Frameworks/CoreNFC.framework/CoreNFC
Referenced from: /var/...
Reason: image not found" message
we have to pay attention to LINK section.
Link section:
Xcode 12.5 does not allow "optional" linking in its menus
we must go to "Other Linker flags" and add:
-weak_framework
CoreNFC
on 2 lines
(in text will be:
OTHER_LDFLAGS = -weak_framework CoreNFC -lstdc++
)
I was having same issue with my application, Although I wasn't using CoreNFC framework. this gets solved with
Xcode-12.2 beta 2. Released on September 29, 2020
In Xcode12 beta4 or beta5, I encounter a failure in my project.
I can run the Project on my device, but it is not running in the simulator.
I get the failure message:
ld: in /libwebrtc.a(dequantizemmx.o), building for iOS Simulator, but linking in object file built for free standing, file 'libwebrtc.a' for architecture x8664.
So does anyone know what settings should be adjusted in Xcode 12.4?
Response from Apple on similar issue.
You’ll need a few changes to support the new Xcode.
Package your framework using XCFrameworks.
Don’t install your SDK into the iOS SDK. Your users should drag drop the XCFramework into their project.
What things needs to changed or updated to run the a project created using Xcode 3.2 in Xcode 10? So, far I have changed the architecture to standard architecture and deployment target to iOS 10.0. Previously it was iOS 5.0, and supported device was iPhone 7 plus. I have also deleted Info.plist. But now I am getting the following error:
Also would like to mention that CocoaPods isn't used in the project. Has anyone faced similar issue and were able to resolve it?
I installed Xcode 9 and trying to run my app on ios simulator 11.0. As soon as it launches the app its crashing giving this error. What does this error mean? If my app is not compatible with ios11.0, how can I check for the compatibily?
EDIT - Uploaded my valid Architectures
You need to make these changes in build setting ... it works for me
I had the same problem and found out that the architectures and valid architectures settings for my targets (and pods) were set wrong. iOS 11 doesn't support 32bit applications anymore, so I guess that took part in my problem..,
I've deleted my architectures + valid architectures settings (made it default) and now it compiles and runs fine in both simulator and iOS 11 device. hope it helps u as well ;).
Been all around with this one, still needing help
1) In xCode when I am archiving to submit to TestFlight I get the following error
2) I have researched and changed the architecture to Arm64 and the Debug to Yes The Build to No
The build completely Fails
3) & I get the LLVM Warning
So I change the optimization Level from Fastest to Fast
4) Normally I could build to my phone / unplug it and then Archive.
But I can't get as far as a build to my phone anymore. This is a project coming from Unity that has worked well in the past.
I work with AR some bundles that now give errors so I take them off
I also add the Core Text Framework to get rid of the Mach-O errors
I'm running the latest Unity the latest xCode in hopes of bug fixes
I have even tried reverting to older version of Unity
Thanks
~ Be
You should use latest version of unity and Xcode. When you build your project in unity, change architecture type to universal in player setting.