homeeondemand / react-native-mapbox-navigation

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

warning: already initialized constant Pod::TargetsToChangeToDynamic #49

Open mariovillamizar opened 2 years ago

mariovillamizar commented 2 years ago

Hey thanks in advance for the library. I'm trying to install it, but I'm getting an error trying to install the pods: Screen Shot 2021-09-07 at 2 37 59 PM

I'm following the steps and trying clean installs but without success. Any ideas on this? Thanks

mariovillamizar commented 2 years ago

Hello?... Is this library maintained?

mariovillamizar commented 2 years ago

Take a look of this project. I'm using node v14.16.1 (npm v6.14.12) and pod 1.11.2 mapboxdemo.zip

zoolle commented 2 years ago

@mariovillamizar you might want to run rm -rf podfile.lock pods && pod install

mariovillamizar commented 2 years ago

@zoolle that could work. However I was able to continue by patching the .podspec file with this:

if (defined?(TargetsToChangeToDynamic)).nil?
  TargetsToChangeToDynamic = ['MapboxMobileEvents']
elsif TargetsToChangeToDynamic.include? 'MapboxMobileEvents' === false
  TargetsToChangeToDynamic.push('MapboxMobileEvents')
end

This is the content of the patch file:

diff --git a/node_modules/@homee/react-native-mapbox-navigation/react-native-mapbox-navigation.podspec b/node_modules/@homee/react-native-mapbox-navigation/react-native-mapbox-navigation.podspec
index 011f14b..895bf38 100644
--- a/node_modules/@homee/react-native-mapbox-navigation/react-native-mapbox-navigation.podspec
+++ b/node_modules/@homee/react-native-mapbox-navigation/react-native-mapbox-navigation.podspec
@@ -2,7 +2,11 @@ require "json"

 package = JSON.parse(File.read(File.join(__dir__, "package.json")))

-TargetsToChangeToDynamic = ['MapboxMobileEvents']
+if (defined?(TargetsToChangeToDynamic)).nil?
+  TargetsToChangeToDynamic = ['MapboxMobileEvents']
+elsif TargetsToChangeToDynamic.include? 'MapboxMobileEvents' === false
+  TargetsToChangeToDynamic.push('MapboxMobileEvents')
+end

 $RNMBNAV = Object.new

I didn't create a pull request because I'm not too sure that it's a good solution. I'm not even familiar with Ruby.

spacemonkey commented 2 years ago

Hello?... Is this library maintained?

Just wanted to chime in here - it is, but we are currently working on internal projects and don't have a ton of capacity. As a longtime FOSS contributor we are wide open to contributions from the world writ large :)