googlemaps / google-maps-ios-utils

Google Maps SDK for iOS Utility Library
https://developers.google.com/maps/documentation/ios-sdk/utility/
Apache License 2.0
712 stars 399 forks source link

SPM integration not working when archiving app for the AppStore #342

Open ztepsa opened 3 years ago

ztepsa commented 3 years ago

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:

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:

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.

arriolac commented 3 years ago

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?

LukeDurrant commented 3 years ago

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

michael-mckenna commented 3 years ago

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.