react-native-mapbox-navigation icon indicating copy to clipboard operation
react-native-mapbox-navigation copied to clipboard

warning: already initialized constant Pod::TargetsToChangeToDynamic

Open mariovillamizar opened this issue 4 years ago • 5 comments

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 avatar Sep 07 '21 19:09 mariovillamizar

Hello?... Is this library maintained?

mariovillamizar avatar Oct 04 '21 13:10 mariovillamizar

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

mariovillamizar avatar Oct 04 '21 16:10 mariovillamizar

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

zoolle avatar Oct 05 '21 13:10 zoolle

@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.

mariovillamizar avatar Oct 05 '21 14:10 mariovillamizar

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 :)

spacemonkey avatar Oct 05 '21 18:10 spacemonkey