React native can't install React-native maps (Android)

I cannot install react native native-native-maps, I get this error when I try to build with run-android-android (I haven't tried iOS yet):

There was a problem setting up project ': app'. Failed to resolve all dependencies for configuration: app: _debugApk. A configuration named "default" was not found.

I followed the instructions below:

https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md

when i run:

react-native link

      

I get:

rnpm-install info iOS module react-native-maps is already linked
rnpm-install info Android module react-native-geocoder is already linked
rnpm-install info iOS module react-native-geocoder is already linked

      

It's the seams that it worked on iOS but not Android, although it worked for the geocoder (and the service works fine).

So, I have described the instructions manually and edited (but I still get the error above):

Android / app / build.gradle
android / settings.gradle
MainApplication.java
android \ app \ src \ main \ AndroidManifest.xml (already changed for geocoder).

I played around a bit with the version numbers in the build.gradle file:

// instructed in the installation guide -> build fail see above
compile project(':react-native-maps')
// Version 0.12.1 and earlier -> Build success but ERROR 500 in the app
compile 'com.airbnb.android:react-native-maps:0.12.1'
// Version 0.12.2 and later -> error see below

      

There was a problem setting up project ': app'. Failed to resolve all dependencies for configuration: app: _debugApkCopy. Could not find com.airbnb.android: react-native-maps: 0.12.2.

I tried different things but nothing worked. I tried the stuff from this link (but it is not out of date):

cannot evaluate modules "react-native-maps": Configuration named "default" not found

Note: I am based on react 0.42.0

+3


source to share


2 answers


I posted the issue in the git center for the react-native-maps project and got the solution there .

For those having the same problem, the solution for me was that the instructions for changing android / settings.gradle are missing / lib /

This gives:



include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')

      

If it still doesn't work, you can try to remove .babelrc from node_modules / react-native-maps /

+1


source


Have you tried using native-maps v0.13.0? I am also on RN42 and this version works for me.



0


source







All Articles