Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The file libswiftCore.dylib doesn’t have the correct code signature

I know this question is asked many time and people's proposed many solutions. In my case, I have tried all of them. what I tried is FYI: I can't use xcode for the build. Reason: I am working on chromium ios code everything build using GN build system.

  • Created SwiftSupport folder and make it part of ipa file.
  • Also signed Dylib under my framework and under SwiftSupport folder.
  • a complete application is signed with the same identity verified through a terminal.

Does anyone have an idea what else apple required for signing? More troubleshooting steps most welcome.

like image 886
Muhammad Shauket Avatar asked Nov 06 '22 16:11

Muhammad Shauket


1 Answers

I fixed this issue let me summarize and make it helpful for everyone who facing this issue, Here are some troubleshooting steps.

  • Xcode build setting in my case I changed through some script, if you are using some build system to make Xcode project then add swift embed library always to YES, otherwise you can go to Xcode build setting and set a flag to YES

  • Change your IPA to .zip and then unzip, there should be SwiftSupport folder like this SwiftSupport/iphoneos/all dylib library that required by your project.

  • If Swift Support folder not exists then you have to create swift support folder and append with IPA using some command through a terminal, for my case I did like this. zip -r chose_your_ipa_name.ipa Payload SwiftSupport , Payload folder will contain .app file and SwiftSupport folder contain .dylib like this hierarchy SwiftSupport/iphoneos/*.dylib

  • SwiftSupport folder library should be code sign by apple certificate, not your certificate. To make it work Just copy .dylib from this path "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/"

  • Library under your this framework folder Payload/Framework/.dylib library should be signed by your certificate.

Now very important point that should not be miss

  • Check architecture info of your library under Payload/Framework/*.dylib , using lipo -info path_of_dylib , If it contains framework arm64e , remove this arch somehow this not working, I also don't know the reason (if anyone know please let me know also) After that code signs your lib with same code identity.

  • Make .ipa file using again using terminal like this way. zip -r your_app_name.ipa Payload SwiftSupport, Make sure these directory does not contatins.DS_Store hidden files, if exits remove them before making ipa.

Hope so these troubleshooting steps will work :) If anything I missed Sorry for that :) If you want more discussion kindly let me know via email or comment here. [email protected]

like image 134
Muhammad Shauket Avatar answered Nov 15 '22 05:11

Muhammad Shauket