mapbox / mapbox-maps-ios

Interactive, thoroughly customizable maps for iOS powered by vector tiles and Metal
https://www.mapbox.com/mapbox-mobile-sdk
Other
462 stars 151 forks source link

Asset validation failed - Code=90482 - MapboxMobileEvents.framework/MapboxMobileEvents contains bitcode #2233

Open agugel opened 1 week ago

agugel commented 1 week ago

Environment

Observed behavior and steps to reproduce

I created an archive of my app in XCode 16.0 RC and use Transporter to update the .ipa file. The validation failed with 3 errors:

... httpBody: { "errors" : [ { "id" : "e824bc7d-dc90-4616-8bd4-6cd3868bdba0", "status" : "409", "code" : "STATE_ERROR.VALIDATION_ERROR.90482", "title" : "Asset validation failed", "detail" : "Invalid Executable. The executable 'nvpocketmaps.app/Frameworks/MapboxCommon.framework/MapboxCommon' contains bitcode." }, { "id" : "82da59eb-8bc2-40cc-ac9d-ce2f5c16b31f", "status" : "409", "code" : "STATE_ERROR.VALIDATION_ERROR.90482", "title" : "Asset validation failed", "detail" : "Invalid Executable. The executable 'nvpocketmaps.app/Frameworks/MapboxCoreMaps.framework/MapboxCoreMaps' contains bitcode." }, { "id" : "4437794a-dfd8-4d0a-af54-0397617f8604", "status" : "409", "code" : "STATE_ERROR.VALIDATION_ERROR.90482", "title" : "Asset validation failed", "detail" : "Invalid Executable. The executable 'nvpocketmaps.app/Frameworks/MapboxMobileEvents.framework/MapboxMobileEvents' contains bitcode." } ] }

Expected behavior

no error during .ipa file upload to AppStoreConnect

Notes / preliminary analysis

Additional links and references

aleksproger commented 1 week ago

Hey, @agugel I created internal ticket to track the issue and we definitely need to consider removing bitcode from MapSDK v10. However, I want to ask whether you were able to upload your builds with our SDK to AppStore previously and which Xcode did you use for that? In my understanding AppStore should have blocked all uploads with bitcode since Xcode 14 Also, MapsSDK v11 already has bitcode removed, so you may want to try it out

agugel commented 1 week ago

I did not have the problem before using XCode 15.

I will try to use MapsSDK v11 in the future. But for now this is not an option for me, because I didn't have the time to implement some features (like offline maps) with the new API.

vanHoi commented 1 week ago

We have exactly the same issue. When targetting iOS 18, we upgraded to Mapbox 10.18.2, which makes the build in XCode 16 work. However, when uploading the .ipa to AppStore connect, we get the same error about the bitcode.

Bitcode is disabled for our project.

We previously used XCode 15.2, which worked fine.

agugel commented 1 week ago

I found a way to manually remove the bitcode data. At least my app is currently uploading to AppStoreConnect.

#!/bin/bash

strip=`xcrun -sdk iphoneos --find bitcode_strip`

strip_it () {
    local file=$1

    echo "before"
    ls -la $file
    echo "...bitcode_strip..."
    $strip -r $file -o $file
    echo "after"
    ls -la $file
    echo ""
}

strip_it Pods/MapboxMobileEvents/MapboxMobileEvents.xcframework/ios-arm64_armv7/MapboxMobileEvents.framework/MapboxMobileEvents
strip_it Pods/MapboxCommon/MapboxCommon.xcframework/ios-arm64/MapboxCommon.framework/MapboxCommon
strip_it Pods/MapboxCoreMaps/MapboxCoreMaps.xcframework/ios-arm64/MapboxCoreMaps.framework/MapboxCoreMaps
aleksproger commented 6 days ago

Nice, that you have found workaround for that. It seems like some checks for AppStore Connect have been changed and now it's more strict about what users ship with Xcode 16. Basically, all our v10 versions currently shipped with bitcode, while v11 shipped without bitcode already. I will let you know in this thread when we release an new v10 version without bitcode, hope there would be no blockers. Thanks for useful feedback.

vanHoi commented 5 days ago

Thanks for the update!

Based on the workaround from @agugel, I added these lines at the end of my Podfile as a workaround, which also fixes the issue for now:

post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'MapboxMobileEvents'
        `xcrun -sdk iphoneos bitcode_strip -r Pods/MapboxMobileEvents/MapboxMobileEvents.xcframework/ios-arm64_armv7/MapboxMobileEvents.framework/MapboxMobileEvents -o Pods/MapboxMobileEvents/MapboxMobileEvents.xcframework/ios-arm64_armv7/MapboxMobileEvents.framework/MapboxMobileEvents`
      end

      if target.name == 'MapboxCommon'
        `xcrun -sdk iphoneos bitcode_strip -r Pods/MapboxCommon/MapboxCommon.xcframework/ios-arm64/MapboxCommon.framework/MapboxCommon -o Pods/MapboxCommon/MapboxCommon.xcframework/ios-arm64/MapboxCommon.framework/MapboxCommon`
      end

      if target.name == 'MapboxCoreMaps'
        `xcrun -sdk iphoneos bitcode_strip -r Pods/MapboxCoreMaps/MapboxCoreMaps.xcframework/ios-arm64/MapboxCoreMaps.framework/MapboxCoreMaps -o Pods/MapboxCoreMaps/MapboxCoreMaps.xcframework/ios-arm64/MapboxCoreMaps.framework/MapboxCoreMaps`
      end
    end
  end
bitrise-silver commented 2 days ago

+1 on stripping bitcode before building as workaround and updating dependencies as ultimate solutions. It seems Xcode 16 enforces a stricter rules on bitcode validation. You can find some documented known issues on Xcode 16 RC here https://discuss.bitrise.io/t/xcode-16-known-issues/24484