react native can't install react-native-maps (Android)
I can't install react native react-native-maps, i get this error when i try to build with react-native run-android (I didn't try on iOS yet) :
A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugApk'. Configuration with name 'default' not found.
I followed the instructions here :
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 seams that it worked on iOS but not on android although for geocoder it worked (and the service is working fine).
So i follwed manual instructions and edited (but i still get the error above) :
android/app/build.gradle
android/settings.gradle
MainApplication.java
android\app\src\main\AndroidManifest.xml (was already edited for geocoder).
I did play a bit with the version numbers in build.gradle :
// 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
A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugApkCopy'. Could not find com.airbnb.android:react-native-maps:0.12.2.
I've tryed different things but nothing worked. I tryed stuff from this link (but it seams deprecated) :
cannot evaluate module 'react-native-maps' : Configuration with name 'default' not found
Note : I'm on react-native 0.42.0
I posted an issue on git hub for react-native-maps project and got the solution there.
For those who have the same problem, the solution for me was that the instructions to change the android/settings.gradle are missing a /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's still not working you might try to remove the .babelrc from node_modules/react-native-maps/
Have you tried using react-native-maps v0.13.0 ? I'm also on RN42 and that version works for me.
Comments
Post a Comment