SPM integration not working when archiving app for the AppStore
GoogleMapsUtils framework works with SPM when building and working with the app, but the issue shows when trying to upload final app to the AppStore due to unsupported architectures.
I tested out all of the possible integration methods, and none seem to be working:
-
CocoaPods-> After addingGoogleMapsUtilsusing CocoaPods it's not possible to include the framework (something wrong with podspec?) -
Carthage-> Fails to build due to issue with new Xcode, there's a workaround but it's a hassle, check Xcode12Workaround -
SwiftPackageManager-> This one works until you try to build the app for the AppStore.
Environment:
- macOS Catalina 10.15.7
- Xcode 12.0.1 (12A7300)
- GoogleMaps 4.0.0
- GoogleMapsUtils 3.4.0
Steps to reproduce:
- Create new Xcode project
- Embed GoogleMaps using any method
- Embed
GoogleMapsUtilsusing SMP from Xcode 12 - Import frameworks and try to package the app for the AppStore submission
- Observe uploading to AppStore fails due to
Found an unexpected Mach-O header code: 0x72613c21error
Working solution:
- when you download
GoogleMapsUtils.xcframeworkfrom the releases page and manually add it to the project everything works fine
If you'd like I can provide sample project where GoogleMaps is added using CocoaPods and and GoogleMapsUtils is added using SwiftPackageManager and archiving fails.
Thanks for flagging this issue, glad you were able to find a workaround by using the .xcframework directly. I'll need to dig into what's going on with the SPM integration in the meantime. EDIT: I found this article with the error code that you shared, take a look to see if this might the issue: https://kobkrit.com/how-to-fix-found-an-unexpected-mach-o-header-code-0x72613c21-on-submitting-to-app-store-7d5b8ec180c
For the second issue you raised, is the issue quite similar to the SPM issue or does the application not compile at all? The Objective-C and Swift samples found within ./samples use CocoaPods as a package manager so I'm curious why that didn't work for you. If you don't mind, can you copy/paste your Podfile, or better yet, attach a sample project?
Google and Firebase Frameworks all suffer from the same issue see https://github.com/firebase/firebase-ios-sdk/issues/6472
I was able to upload by right clicking the archive and doing the following: Show in Finder -> Right Click App -> Show Package Contents -> Products -> Applications -> Show Package Contents (again)
Then from here, delete anything Google/firebase related in Plugins and Frameworks.