rnmapbox / maps

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

MacOS 15 Xcode build Error #3625

Open Bayramito opened 1 week ago

Bayramito commented 1 week ago

Environment

Steps to reproduce

Ekran Resmi 2024-09-17 13 21 56

i got this error after i upgraded my xcode to 16

73k05 commented 1 week ago

Hi,

just got the same issue few minutes ago 🫤 I also had to upgrade sentry to ~5.30.0 to fix another issue mixing up package deps validation with expo

Regards 73k05

Bayramito commented 1 week ago

Hi,

just got the same issue few minutes ago 🫤 I also had to upgrade sentry to ~5.30.0 to fix another issue mixing up package deps validation with expo

Regards 73k05

Same here. I also upgraded to latest

predescu commented 1 week ago

I've managed to build the app on Xcode 16 and iOS 18 with the following changes:

  1. upgrade the Mapbox version in the pod file $RNMapboxMapsVersion = '=11.6.0' Previously I had $RNMapboxMapsVersion = '=11.3.0' After this first change, I've received another error, and with the help from here: https://stackoverflow.com/a/78633109/590626
  2. adding the following code into the target.build_configurations.each do |config| block
    if target.name == 'BoringSSL-GRPC'
    target.source_build_phase.files.each do |file|
    if file.settings && file.settings['COMPILER_FLAGS']
      flags = file.settings['COMPILER_FLAGS'].split
      flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
      file.settings['COMPILER_FLAGS'] = flags.join(' ')
    end
    end
    end
73k05 commented 1 week ago

Hi @predescu

thank you for the quick & dirty, I still have the error with the command bun expo run ios I guess you execute pod install in the meantime? I can't use this command at the moment...

Regards 73k05

chris-gaona commented 1 week ago

I got the same error with this dependency after fixing the sentry issue. These errors occurred after upgrading my mac to xcode 16 too. I was able to resolve the issue by upgrading the mapbox version in my podfile to $RNMapboxMapsVersion = '=11.6.0' & then upgrading to the latest version of this dependency: "@rnmapbox/maps": "10.1.31"

I'm running expo 51 & react native 0.74.5

enlivn commented 1 week ago

I've managed to build the app on Xcode 16 and iOS 18 with the following changes: ...

  1. adding the following code into the target.build_configurations.each do |config| block
if target.name == 'BoringSSL-GRPC'
  target.source_build_phase.files.each do |file|
    if file.settings && file.settings['COMPILER_FLAGS']
      flags = file.settings['COMPILER_FLAGS'].split
      flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
      file.settings['COMPILER_FLAGS'] = flags.join(' ')
    end
  end
end

I guess it's pretty obvious but you need to change the name check to if target.name == 'MapboxMaps' so in case anyone is copy-pasta'ing without reading too carefully ;) ,

if target.name == 'MapboxMaps'
  target.source_build_phase.files.each do |file|
    if file.settings && file.settings['COMPILER_FLAGS']
      flags = file.settings['COMPILER_FLAGS'].split
      flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
      file.settings['COMPILER_FLAGS'] = flags.join(' ')
    end
  end
end

cc @73k05 in case this was your issue.

Bayramito commented 1 week ago

I've managed to build the app on Xcode 16 and iOS 18 with the following changes: ...

  1. adding the following code into the target.build_configurations.each do |config| block
    if target.name == 'BoringSSL-GRPC'
    target.source_build_phase.files.each do |file|
    if file.settings && file.settings['COMPILER_FLAGS']
      flags = file.settings['COMPILER_FLAGS'].split
      flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
      file.settings['COMPILER_FLAGS'] = flags.join(' ')
    end
    end
    end

I guess it's pretty obvious but you need to change the name check to if target.name == 'MapboxMaps' so in case anyone is copy-pasta'ing without reading too carefully ;) ,

if target.name == 'MapboxMaps'
  target.source_build_phase.files.each do |file|
    if file.settings && file.settings['COMPILER_FLAGS']
      flags = file.settings['COMPILER_FLAGS'].split
      flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
      file.settings['COMPILER_FLAGS'] = flags.join(' ')
    end
  end
end

cc @73k05 in case this was your issue.

Unfortunately this one did not help to me

Bayramito commented 1 week ago

EDIT: it was my fault that i leave some miss version implementation of mapbox in podfile. Now it's working fine

73k05 commented 1 week ago

Hi @Bayramito ,

It worked for me thank you guys! Indeed I followed @chris-gaona steps:

I got the same error with this dependency after fixing the sentry issue. These errors occurred after upgrading my mac to xcode 16 too. I was able to resolve the issue by upgrading the mapbox version in my podfile to $RNMapboxMapsVersion = '=11.6.0' & then upgrading to the latest version of this dependency: "@rnmapbox/maps": "10.1.31"

I'm running expo 51 & react native 0.74.5

I also upgraded macOS to Sequoia 15.0

@enlivn thank you, I did not need to have to add the specific COMPILER_FLAGS loop code to make it work but I had to remove the Podfile.lock after having this issue:

⚠️  Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: CocoaPods could not find compatible versions for pod "MapboxMaps":
  In snapshot (Podfile.lock):
    MapboxMaps (= 11.0.0)
  In Podfile:
    rnmapbox-maps (from `../node_modules/@rnmapbox/maps`) was resolved to 10.1.31, which depends on
      MapboxMaps (= 11.6.0)
You have either:
 * changed the constraints of dependency `MapboxMaps` inside your development pod `rnmapbox-maps`.
   You should run `pod update MapboxMaps` to apply changes you've made.
pod install --repo-update --ansi exited with non-zero code: 1

Build on iOS

Expo 50.0.17 ReactNative 0.73.6 iOS 18 Xcode 16.0 macOS Sequoia 15.0

Peace 73k05

waraness99 commented 1 week ago

I got the same error with this dependency after fixing the sentry issue. These errors occurred after upgrading my mac to xcode 16 too. I was able to resolve the issue by upgrading the mapbox version in my podfile to $RNMapboxMapsVersion = '=11.6.0' & then upgrading to the latest version of this dependency: "@rnmapbox/maps": "10.1.31"

I'm running expo 51 & react native 0.74.5

It worked! Thanks @chris-gaona!

jael0x commented 1 week ago

https://github.com/rnmapbox/maps/issues/3625#issuecomment-2357615603

That worked for me, thanks @73k05

But in my case, After the app is uploaded, shows me some warnings, should I be worried about that?

gremech commented 1 week ago

Updating maps to v11 doesn't work for me as I also use MapboxNavigation v2 which depends on Maps v10. So I had to make a dirty change directly in ViewAnnotationManager.swift, to get it to at least compile until I found a solution

public var annotations: [UIView: ViewAnnotationOptions] {
    idsByView.compactMapValues { [mapboxMap] id in
        try? mapboxMap.options(forViewAnnotationWithId: id)
    } as [UIView: ViewAnnotationOptions]
}
gremech commented 1 week ago

UPD. For those who have to stay on maps v10 MapboxMaps v10.18.2 is compatible with MapboxNavigation v2.18.4 and compiles on the new xcode 16

$RNMapboxMapsVersion = '~> 10.18.2'
hot2eatorg commented 6 days ago

I got the same error with this dependency after fixing the sentry issue. These errors occurred after upgrading my mac to xcode 16 too. I was able to resolve the issue by upgrading the mapbox version in my podfile to $RNMapboxMapsVersion = '=11.6.0' & then upgrading to the latest version of this dependency: "@rnmapbox/maps": "10.1.31"

I'm running expo 51 & react native 0.74.5

I owe you a beer! For expo user, just upgrade the the @rnmapbox/maps by running:

npm install @rnmapbox/maps@10.1.31

And then set the mapbox version to 11.6.0 in you plugins app config:

[
    "@rnmapbox/maps",
    {
      "RNMapboxMapsVersion": "11.6.0",
    }
]
enlivn commented 5 days ago

#3625 (comment)

That worked for me, thanks @73k05

But in my case, After the app is uploaded, shows me some warnings, should I be worried about that?

@jael0x do you want to post this as a new issue? I was wondering about this too. Without the dSYMs, it's gonna be annoying/impossible to de-symbolicate stack traces once the app is released.

edit: just want to note that I've tried the following 2 things without success

  1. add the Mapbox frameworks to the Link Binary with Libraries in the xcodeproj
  2. update the Podfile post-install hooks:
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
        end
      end
    end
tyrauber commented 2 days ago

Edit: With Xode 16, I was getting the ViewAnnotationManager.swift error with RNMapboxMapsVersion 11.3.0 and @rnmapbox/gl@10.1.28, but bumping up the SDK to 11.6.0 or down to 10.18.2 builds on Xcode 16. Thanks everyone!

enlivn commented 2 days ago

#3625 (comment) That worked for me, thanks @73k05 But in my case, After the app is uploaded, shows me some warnings, should I be worried about that?

@jael0x do you want to post this as a new issue? I was wondering about this too. Without the dSYMs, it's gonna be annoying/impossible to de-symbolicate stack traces once the app is released.

edit: just want to note that I've tried the following 2 things without success

  1. add the Mapbox frameworks to the Link Binary with Libraries in the xcodeproj
  2. update the Podfile post-install hooks:
    post_install do |installer|
     installer.pods_project.targets.each do |target|
       target.build_configurations.each do |config|
         config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
       end
     end
    end

didn't hear back so I've created an issue myself: #3637