homeeondemand / react-native-mapbox-navigation

A navigation UI ready to drop into your React Native application
MIT License
160 stars 122 forks source link

Multiple commands produce #97

Open Polyrion opened 2 years ago

Polyrion commented 2 years ago

Hi all, I followed the doc and even with

install! 'cocoapods', :disable_input_output_paths => true

its impossible to build. I also tried on a fresh installation of React Native 0.69.1 same issue.

There is my Podfile :

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :disable_input_output_paths => true
install! 'cocoapods', :deterministic_uuids => false

target 'mapboxnavigation' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'mapboxnavigationTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  pre_install do |installer|
    $RNMBNAV.pre_install(installer)
    # any other pre install hooks here
  end

  post_install do |installer|
    $RNMBNAV.post_install(installer)
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

For Xcode version I'm on 13.4.1 For more information I tried to build IOS 15.5 and 15.2

Does someone success to make it run recently ?

Thanks

Polyrion commented 2 years ago

There is an alternative with MapBox Navigation SDK 2.6 I made an article and you have a repo available with all explanation https://medium.com/@youssef.alakkad/implement-mapbox-navigation-with-react-native-f6b7fb4345e5

eznix86 commented 2 years ago
install! 'cocoapods', :disable_input_output_paths => true # <----- NEW

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'app' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'appTests' do
    inherit! :complete
    # Pods for testing
  end

  pre_install do |installer| # <----- NEW
    $RNMBNAV.pre_install(installer) # <----- NEW
  end # <----- NEW

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    flipper_post_install(installer) # <----- NEW
    $RNMBNAV.post_install(installer) # <----- NEW
  end

end
daanlenaerts commented 2 years ago

@Polyrion did you also remember to run pod install again after making this change to your Podfile?

amritk commented 2 years ago

Made a little plugin for this

yarn add @driveapp/expo-plugin-pod-disable-paths

then add to your plugins in config file

  plugins: [
    '@driveapp/expo-plugin-pod-disable-paths',
  ],