iOS build issue With Xcode (10.2) - ios

My Xcode Version is 10.2 and MacOS Version is 10.14.4.
I am new to iOS. I have a project in Unity, which I export and build in Xcode. If I build my project with Xcode-9.4 it works perfectly. But When I try to build my project with XCode-10.2 it gives me this error:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/containers/Bundle/Application/FE30DBA8-091A-4350-9E8F-2CAF3FF03497/MyApp.app/Frameworks/libBluetooth.framework/libBluetooth
Reason: image not found
I have google it a lot but found nothing helpful any help is highly appreciated.
Below are the solutions I have already tried.
Always Embed Swift Standard Libraries => Yes (Not helpful)
"Clean" my project (shift+cmd+K) a
My Apple World Wide Certificate is already valid.

This fixed it for me :
Close Xcode
Open Keychain Access
Right click on your certificate -> Get Info
Under Trust -> Change When using this certificate value to Use System Default

Related

dyld: Library not loaded: #rpath/libswiftCore.dylib after Xcode Update

I am having problems with an app I've been working on for a while. Everything was fine until went mad and updated Xcode to 9.4 (previously 9.3).
I'm using a third party framework compiled on swift 4.0.3. I worked perfectly, but after the update it wouldn't compile (can't build the framework compiled on 4.0.3 with 4.1). I downloaded and installed the Swift 4.0.3 Release Toolchain and i'm able to build with no errors.
However, when I run the target on the device (iOS 9.0 ipad) it crashes with dyld`dyld_fatal_error:
dyld`dyld_fatal_error:
0x1fe9008c <+0>: trap
0x1fe90090 <+4>: nop
The console outputs this:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/containers/Bundle/Application/2E966F50-67E3-4250-858C-382319CD6274/myApp.app/Frameworks/myFramework.framework/myFramework Reason: Incompatible library version: myFramework requires version
1.0.0 or later, but libswiftCore.dylib provides version 0.0.0
Some Facts:
The Framework is in Embedded Binaries and Linked Frameworks and Libraries under General and Link Binaries with Libraries and Embed Frameworks under Build Phases.
This app need's to deploy on iOS 9.0 and the Deployment target is set accordingly.
I installed Xcode 9.3 again, but I had the same problem using the 4.0.3 toolchain.
My suspicions:
Can the Toolchain be corrupted in some way? I installed Swift 4.0.3 Release 2017-12-05 (a)
Even though I am working with the 4.0 toolchain, I can only choose from 4.1 and 3.3 under Swift Compiler in Build Settings. I imagine this is overwritten, but not sure.
My main concern is that even though the deployment target is set to iOS 9.0, under the BASE SDK is set to 11.3, and can't choose another. I can't find the 9.0 SDK on the internet. Could this be the problem?
Also, all of my certificates are valid and ok.
Thanks in advance, I'll add edits every time I find something new.
Well, I didn't receive any help here, but just in case anyone needs to know, the only way I managed to solve this was asking for an updated version of the framework we are using. It appears this is a compatibility problem that has no solution.
Following #Danf instructions solved for me.

dyld: Library not loaded: #rpath/libswiftCore.dylib on Xcode 9 only

I recently upgraded to Xcode 9 from 8.3.3.
Our project is written in Objective-C as are all the other frameworks we use. I have added a framework which is written in Swift (version 3.0). In Xcode 8, I am able to build and run the project without problem in simulator and on device. In Xcode 9 I am unable to run the project on simulator or device due to the error:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: .../libraryname
Reason: image not found
After downgrading, I was able to run the project again.
My configuration has:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
STRIP_SWIFT_SYMBOLS = NO;
SWIFT_VERSION = 3.0;
After battling for several hours with this error and trying various solutions, my solution turned out to be different than others here so I'm adding it for others who may benefit.
I tried:
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
- LD_RUNPATH_SEARCH_PATHS = $(inherited) #executable_path/Frameworks
No luck. Turned out the issue was more basic. My project has multiple build targets and somehow the setting for Host Application had gotten unset.
The Swift framework has to be built with the same version of Swift as your project (in this case Swift 4 inherantly since you upgraded and are running through Xcode 9).
Rebuild and re-add/replace the framework with the new version and it should work.
Are you using Carthage and have multiple XCode_s on your machine? I had an issue recently when I ran
carthage update --use-ssh --platform iOS while xcode8.3.3 was selected in the command line. Then included built frameworks into the build.
For it to work in XCode9 you will need to run switch command
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer for your Xcode.app and run carthage again.
Hope it helps.
Had the same problem. I'm using Xcode 9.2, Swift 4 and my device runs in iOS 11.1.
Solution:
I deleted Apple Worldwide Developer Relations Certificate Authority in Keychain Access and replace it with a new one (you can download certificate here)
After that, I have changed "Trust"(double-click the certificate) from "Always Trust" to "System Default".
Try restarting Xcode. I tried everything else and this is what stopped the problem.
It mainly occurs if your certificate trust settings is set to "Always Trust". Change it to "System Defaults" and recreate the build. This should solve the issue: https://egeek.me/2017/10/21/code-signing-blocked-mmap-on-ios-device/
I faced the same problem (on Xcode 9.4.1) but couldn't solve it with any of the help. I faced a problem where Xcode kept on prompting me to use my keychain but couldn't complete the request—although I gave my password. The app built successfully and installed. However, it crashed upon running on the device immediately.
Here's what solved my issue.
Deleted my Certificate & public/private key pair
Created a new Certificate (via a CSR) and installed it on my computer
Linked the new certificate to the provisioning profile and installed the profile on Xcode
Cleaned the build and deleted the existing build on the device
Hurray!!!
Hope this helps someone who is searching through the planet!
Just clean and built solve this problem. Tested in Xcode 9.2 and Swift 4

Onesignal Unity IOS Build Symbol not found error

I am developed a game with Unity3D and exported IOS build. Xcode build project succesfully but App crash on launch.
Firstly I got this error:
dyld: Library not loaded: #rpath/OneSignalXC8.framework/OneSignalXC8 Referenced from: /var/containers/Bundle/Application/xxxx
Reason: image not found
After this, I added OneSignalXC8 framework to embeded binaries and error changed.
dyld: Symbol not found: __TMaCs29_NativeDictionaryStorageOwner
Referenced from: /private/var/containers/Bundle/Application/xxxx.app/Frameworks/OneSignalXC8.framework/OneSignalXC8
Expected in: /private/var/containers/Bundle/Application/xxxx.app/Frameworks/libswiftCore.dylib
in /private/var/containers/Bundle/Application/xxxx.app/Frameworks/OneSignalXC8.framework/OneSignalXC8
After this error, I set "Always Embed Swift Standard Libraries" to "Yes". Like saying here: https://stackoverflow.com/a/43117611/793880
But still I got same last error. How can I solve this?
I am using Xcode 8.3.3
I am using Unity 5.6.1f1
Unity exporting Xcode Project not workspace
I am using Objective-C
Thanks
I deleted OneSignal folder from Unity project.
Download last released plugin package from https://github.com/OneSignal/OneSignal-Unity-SDK
Import Unity project and build.
Runnning successfully

error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0')

When I try to Archive my application on Xcode 7.3.1, I am getting following error:
error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader:
'703.0.31_0') clang: error: linker command failed with exit code 1
(use -v to see invocation)
I was able to successfully Archive my app yesterday, can any one please help me?
i had this error before ...
you may try the following solution it worked for me
search for bitcode keyword in app --> Build Settings and change it to NO
then archive again -->
it should work fine now
Install Xcode 8:
https://developer.apple.com/download/
Xcode 8 GM seed may be used to submit apps to the App Store.
More info:
In my case I updated to the latest Facebook iOS SDK 4.15.1. Since that library was updated with Xcode 8 and I was still using Xcode 7.3.1 it caused the error.
https://developers.facebook.com/docs/ios/change-log-4.x
Updated for Xcode 8 GM and iOS 10.
So, double check 3rd party libraries.
Or if you don't mind disabling bitcode:
Go to build settings search bitcode and change "Enable Bitcode" to "No".
I also faced the same problem, and as suggested by #Nate,
the issue was because of a third party SDK integrated in our project using Cocoapods.
To help me figure out which one of the 15 pods i had in the project was responsible, i did the following:
Create a new xcode project
Copy the Podfile from your original project to the newly created project's directory
Do pod install
Remove one or more of the pods⋆
Archive the new project, and see if it succeeds, if not repeat step 4 till you are able to archive
⋆(you can also try something like binary search, wherein you delete the first half pods in your Podfile and see if the new project archives)
Once you've figured out the library causing the issue, keep downgrading the library by explicitly specifying the version in Podfile, until the project archives successfully.
And then you can use that version of the library to archive and upload to the app store.
If you are using lib or pod that mean that one of them built by a higher version of your current Xcode, you can either update your code or return back to the previous version where the pods were built by your current version.
If you ran pod update check the pods updated if you ran pod install check the dates of the pods comparing to the release date of your Xcode that will will lead you to the responsible pod.
I got it while I was building using Xcode 8.2.1 and the pod built by Xcode 8.3.1
I also faced this error: Invalid bitcode version (Producer: '800.0.24.1_0' Reader: '703.0.31_0') I have googling so many but unable to find the proper solution. I tried Myself and solved this probable
In my case this error occurs after adding FBSDK by drag and drop that we all usually do.
You can resolve this problem by following these steps:
Delete all pod script in build Phases.
Delete the dragged FBSdks file from the project.
Exit xcode and delete 3 things "Pod folder","Podfile.lock" and "Projectworkspace"
Search and add FBSDK pod link in podfile
Install the pod again by using terminal.... now open Xcode archive your project build.
good solutions, but disabling bitcode worked for some people.
edit :- it worked for me too.
but in future your app might be in problem or (build not optimised by Appstore) if your project is **Bitcode Disable **.
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.
Note: For iOS apps, bitcode is the default, but optional. If you
provide bitcode, all apps and frameworks in the app bundle need to
include bitcode. For watchOS apps, bitcode is required
So thats why try to figure out error solutions right way.
The error basically says:
The static linker could not correctly link a certain bitcode bundle, which was
produced using Producer: '902.0.39.2', and is being read using Reader:
'900.0.37'.
You can look up at https://gist.github.com/yamaya/2924292 to identify the Xcode versions for the corresponding compiler versions. In the current case, the reader (our Xcode version) is Xcode 9.0, whereas the producer (Xcode version of typically a third party SDK) is Xcode 9.4. The incompatibility between the two is the root cause of this issue.
You may either:
turn off the bitcode as discussed in other answers, or
roll-back the SDK to a previous version that worked well, or
update your codebase to use the newer Xcode version.

Xcode Bot bitcode error during integration only

ld: '/Library/Developer/XcodeServer/Integrations/Caches/5c17d3e903f4d302cf453 40fb301f30f/Source/ocular/Pods/Sodium/Sodium/libsodium- ios.a(libsodium_la-crypto_box.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
I ran /usr/local/bin/pod install before integration (Triggers).
I am able to build and run the app in simulator & real device. However my integration with bot failed with the above error message. I install Sodium via cocoapods.
I tried setting ENBALE_BITCODE = NO for project/targets/Pods
Server: 5.1.7
Xcode: 7.3.1
Any help is appreciated.
The error saying that you need to ENBALE_BITCODE = NO under your project target Change that and it will gonna work.
xCode -> your project -> Build Settings -> Enable Bitcode = NO .
After searching for the solutions online and the only solution i can find is Enable Bitcode = NO. Which is what i already had!
So eventually i use the WILD CARD SOLUTION which is to restart Xcode & Server - Still throws the same error. Since there's really no solution, i restarted my mac. First time still throws errors and TADA second time it works.I have no idea what have i done to make it work or what have i not done to make it work.
PS: I clean and clean build folder each time before i integrate my bot.
To anyone who faced the same issue: good luck

Resources