react-native-maps: Cannot evaluate module react-native-maps : Configuration with name 'default' not found
Hello everyone I have some issue when i run project in Android `JS server already running. Building and installing the app on the device (cd android && ./gradlew installDebug…
FAILURE: Build failed with an exception.
-
What went wrong: A problem occurred configuring project ‘:app’.
Cannot evaluate module react-native-maps : Configuration with name ‘default’ not found.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.906 secs Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html`
I use React-native 0.26.2 Thanks in advance
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 10
- Comments: 32 (1 by maintainers)
@andfs, this is work for me (0.29 and 0.30). You must remove :react-native-maps from
build.gradleand addalso manually patch your Application class like
I think it will really help you
But now we can’t use the
rnpm link: after every call,build.gradlebreaks down again (we can repair it manually)It seems that the problem is caused by nested settings.gradle, that are not supported (http://stackoverflow.com/questions/12154031/multiple-settings-gradle-files-for-multiple-projects-building) A workaround is to include the lib subproject in your app settings.gradle:
On an existing project, I found that the
settings.gradlefile needed a minor change:Are you talking about addition of this line and remove the auto maticlly genrater react-native maps compile ‘com.airbnb.android:react-native-maps:0.7.1’ I have applied those things.
In react 0.29.0 itse creating two files MainActivity.java and MainApplication.java
These things are not working
Replacing
MapsPackage(this)withMapsPackage()solved my issue. Readme must be updated accordingly.is there any fix on this? RN(0.44)
include ‘:react-native-maps:lib’ project(‘:react-native-maps’).projectDir = new File(rootProject.projectDir, ‘…/node_modules/react-native-maps/android/lib’)
so this is almost correct but this is what you need to change it to:
include ‘:react-native-maps:lib’ project(‘:react-native-maps’).projectDir = new File(rootProject.projectDir, ‘…/node_modules/react-native-maps/lib/android’)
so for some reason in the node_modules/react-native-maps it should be followed by /android but if you look in the directory you will see that it’s just /lib and Android and iOS is inside of it… it’s backwards sooo if you just change the order of the the directory or the folder whichever to match what you have in your:
settings.gradle
it’s also stated here in the instructions…
https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md
you will be good! Cheers!
In your android/settings.gradle replace the react-native-maps (2 lines) with this:
include ‘:react-native-maps’ project(‘:react-native-maps’).projectDir = new File(rootProject.projectDir, ‘…/node_modules/react-native-maps/lib/android’)
The error for 0.44 is that there is no node_modules/react-native-maps/android’, so change it by adding lib like so: node_modules/react-native-maps/lib/android
hey guys still facing an issue
this is what i did
include ‘:react-native-maps:lib’ project(‘:react-native-maps’).projectDir = new File(rootProject.projectDir, ‘…/node_modules/react-native-maps/android/lib’)
and my MainActivity.java is also updated as ‘new MapsPackage()’ still getting error
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ‘:app’.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
We had to change
MapsPackage()toMapsPackage(this)to stop maps crashing on Sony Xperia Devices https://github.com/lelandrichardson/react-native-maps/pull/276 as it needs the application context