google-maps-ios-utils icon indicating copy to clipboard operation
google-maps-ios-utils copied to clipboard

SPM integration not working when archiving app for the AppStore

Open ztepsa opened this issue 5 years ago • 3 comments

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.

error

I tested out all of the possible integration methods, and none seem to be working:

  1. CocoaPods -> After adding GoogleMapsUtils using CocoaPods it's not possible to include the framework (something wrong with podspec?)
  2. Carthage -> Fails to build due to issue with new Xcode, there's a workaround but it's a hassle, check Xcode12Workaround
  3. SwiftPackageManager -> This one works until you try to build the app for the AppStore.
spm

Environment:

  • macOS Catalina 10.15.7
  • Xcode 12.0.1 (12A7300)
  • GoogleMaps 4.0.0
  • GoogleMapsUtils 3.4.0

Steps to reproduce:

  1. Create new Xcode project
  2. Embed GoogleMaps using any method
  3. Embed GoogleMapsUtils using SMP from Xcode 12
  4. Import frameworks and try to package the app for the AppStore submission
  5. Observe uploading to AppStore fails due to Found an unexpected Mach-O header code: 0x72613c21 error

Working solution:

  • when you download GoogleMapsUtils.xcframework from 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.

ztepsa avatar Oct 19 '20 13:10 ztepsa

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?

arriolac avatar Oct 19 '20 18:10 arriolac

Google and Firebase Frameworks all suffer from the same issue see https://github.com/firebase/firebase-ios-sdk/issues/6472

LukeDurrant avatar Jan 15 '21 01:01 LukeDurrant

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.

michael-mckenna avatar Jan 15 '21 15:01 michael-mckenna