rnmapbox / maps

A Mapbox react native module for creating custom maps
MIT License
2.28k stars 847 forks source link

[Bug]: Bitcode AppstoreConnect Submit Issue (Xcode 16.0) #3638

Closed yungblud closed 1 month ago

yungblud commented 2 months ago

Mapbox Implementation

Mapbox

Mapbox Version

10.1.31

React Native Version

0.75.3

Platform

iOS

@rnmapbox/maps version

10.1.31

Standalone component to reproduce

const Hello = () => null

Observed behavior and steps to reproduce

Similar issue with https://github.com/facebook/hermes/issues/1525#issuecomment-2377348814

When I try to submit to appstore connect my build, Mapbox Bitcode issue has been raised. So I couldn't submit to appstoreconnect.

Expected behavior

Bitcode issue would be resolved with Xcode 16.0

Notes / preliminary analysis

Add this to |post_install| lane of Podfile

bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
    def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
     framework_path = File.join(Dir.pwd, framework_relative_path)
     command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
     puts "Stripping bitcode: #{command}"
     system(command)
    end

    framework_paths = [
     "Pods/MapboxCommon/MapboxCommon.xcframework/ios-arm64/MapboxCommon.framework/MapboxCommon",
     "Pods/MapboxCommon/MapboxCommon.xcframework/ios-arm64_x86_64-maccatalyst/MapboxCommon.framework/MapboxCommon",
     "Pods/MapboxCommon/MapboxCommon.xcframework/ios-arm64_x86_64-simulator/MapboxCommon.framework/MapboxCommon",
     "Pods/MapboxCoreMaps/MapboxCoreMaps.xcframework/ios-arm64/MapboxCoreMaps.framework/MapboxCoreMaps",
     "Pods/MapboxCoreMaps/MapboxCoreMaps.xcframework/ios-arm64_x86_64-maccatalyst/MapboxCoreMaps.framework/MapboxCoreMaps",
     "Pods/MapboxCoreMaps/MapboxCoreMaps.xcframework/ios-arm64_x86_64-simulator/MapboxCoreMaps.framework/MapboxCoreMaps",
     "Pods/MapboxMobileEvents/MapboxMobileEvents.xcframework/ios-arm64_armv7/MapboxMobileEvents.framework/MapboxMobileEvents",
     "Pods/MapboxMobileEvents/MapboxMobileEvents.xcframework/ios-ios-arm64_i386_x86_64-simulator/MapboxMobileEvents.framework/MapboxMobileEvents",
     "Pods/MapboxMobileEvents/MapboxMobileEvents.xcframework/ios-arm64_x86_64-maccatalyst/MapboxMobileEvents.framework/MapboxMobileEvents"
    ]

    framework_paths.each do |framework_relative_path|
     strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    end

and pod install again.

The issue was gone.

Additional links and references

No response

raptorian commented 2 months ago

Using Xcode 15 works as a workaround

jbcrestot commented 2 months ago

look at https://github.com/rnmapbox/maps/issues/3635

yungblud commented 1 month ago

Thanks, I think the issue was resolved by #3635 @jbcrestot Closing this issue.

Gyanprakash73 commented 1 month ago

@yungblud I am facing the above error while Validate App. Please guide what I am leaving.

yungblud commented 1 month ago

@Gyanprakash73 Did you try bump up $RNMapboxMapsVersion in Podfile? Please have a look this line. https://github.com/rnmapbox/maps/blob/a868a536d8a3f4687e039a7bc3f483c076d1fd19/example/ios/Podfile#L13

And the working version would be 11.6.0 I guess. https://github.com/rnmapbox/maps/issues/3635#issuecomment-2383091597