Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot evaluate module react-native-maps : Configuration with name 'default' not found #288

Closed
trinhvanhuy opened this issue Jun 10, 2016 · 32 comments

Comments

@trinhvanhuy
Copy link

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

@symmetriccurve
Copy link

I have the same Error

@eliantor
Copy link

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:

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

@jrichardlai
Copy link
Contributor

@trinhvanhuy @symmetriccurve did the solution worked for you?

@bcalik
Copy link

bcalik commented Jun 15, 2016

I have the same issue. @eliantor It did not work, now I get:

FAILURE: Build failed with an exception.

* Where:
Script '/Volumes/data/mobile/Bulutfilo/node_modules/react-native-maps/android/lib/gradle-maven-push.gradle' line: 48

* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-maps'.
   > No such property: GROUP for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

@bcalik
Copy link

bcalik commented Jun 15, 2016

Looks like installation introduction has changed recently.
I have updated it accordingly. Now I get different error:

/Volumes/data/mobile/Bulutfilo/android/app/src/main/java/com/bulutfilo/MainActivity.java:51: error: constructor MapsPackage in class MapsPackage cannot be applied to given types;
            new MapsPackage(this),
            ^
  required: no arguments
  found: MainActivity
  reason: actual and formal argument lists differ in length
1 error
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

@malinthe
Copy link

Did the same and receiving the same error as @bcalik now.

@malinthe
Copy link

Alright, I think we managed to get it running. We removed this from new MapsPackage(this) in the MainActivity.java file and it doesn't fail anymore.

@bcalik
Copy link

bcalik commented Jun 16, 2016

Replacing MapsPackage(this) with MapsPackage() solved my issue. Readme must be updated accordingly.

@morrigan
Copy link

@bcalik @malinthe

Replacing MapsPackage(this) with MapsPackage() solved my issue. Readme must be updated accordingly.

I don't think this is the right solution because MapsPackage constructor actually needs argument Activity. Without that it is possible to pass build but maps don't load.

@locly
Copy link

locly commented Jun 21, 2016

We had to change MapsPackage() to MapsPackage(this) to stop maps crashing on Sony Xperia Devices #276 as it needs the application context

@bcalik
Copy link

bcalik commented Jun 21, 2016

@morrigan actually it's working well, without an issue.

@trinhvanhuy
Copy link
Author

It's working now, thanks all

@sayedatif
Copy link

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

    A problem occurred configuring project ':react-native-maps'.
    Failed to notify project evaluation listener.
    failed to find Build Tools revision 23.0.3
    No such property: GROUP for class: org.gradle.api.publication.maven.inte
    rnal.deployer.DefaultGroovyMavenDeployer

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

@abdullah-almesbahi
Copy link

i have the same issue , it work nice on IOS .. but fail on android

@darron-haworth
Copy link

I am experiencing this as well. I've made the suggested changes with no success. I am unable to react-native-maps with android.

I was originally using a project initialized with "infinitered-ignite", also tried initializing a blank react-native project and adding the package. Followed the installation steps for "react-native-maps" but still unable to use this package with Android?

Anyone else still running into problems with this?

@darron-haworth
Copy link

darron-haworth commented Jul 5, 2016

Okay, I got this working with the following configuration:
build.gradle
//compile project(':react-native-maps') Comment this out, then add line below
compile 'com.airbnb.android:react-native-maps:0.6.0'
MainActivity.xml
//change new MapsPackage() to:
new MapsPackage(this)
AndroidManifesxt.xml (Add my api key)
<meta-data android:name="com.google.android.geo.API_KEY" android:value="MyApiKeyHere"/>

@sayedatif
Copy link

hey guys you can follow this link for any problem related to the error "cannot evaluate module react-native-maps" http://stackoverflow.com/questions/38095524/cannot-evaluate-module-react-native-maps-configuration-with-name-default-n hope you will get the answer there thanks.

@hnagarkoti
Copy link

hnagarkoti commented Jul 13, 2016

Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 2

I am getting this error after installing react-native-maps and running rnpm link command, i have even removed android/build and android/app/build and rebuild it
React Version : "15.2.1", and "react-native": "0.29.0",

@sayedatif
Copy link

@hnagarkoti rnpm link produces a bug in build.gradle file which you have to remove follow the link http://stackoverflow.com/questions/38095524/cannot-evaluate-module-react-native-maps-configuration-with-name-default-n

@hnagarkoti
Copy link

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

@andfs
Copy link

andfs commented Jul 21, 2016

Still facing this problem in react-native 0.29.2.
Nothing said here worked. If someone has another solution, please tell me

@yozi-developer
Copy link

yozi-developer commented Jul 21, 2016

@andfs, this is work for me (0.29 and 0.30).
You must remove :react-native-maps from build.gradle and add

...
dependencies {
  ...
  compile 'com.airbnb.android:react-native-maps:0.7.1'
}

also manually patch your Application class like

return Arrays.asList(
          new MainReactPackage(),
          new MapsPackage());

I think it will really help you

But now we can't use the rnpm link: after every call, build.gradle breaks down again (we can repair it manually)

@greghaygood
Copy link

Non-Java folks, you may also have to add an import statement for the MapsPackage:

import com.airbnb.android.react.maps.MapsPackage;

Put that with the other import statements at the top of your MainApplication.java.

@cymen
Copy link

cymen commented Sep 15, 2016

On an existing project, I found that the settings.gradle file needed a minor change:

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

@privateOmega
Copy link

@yozi-developer is there a permanent workaround so that I could run link

@cinder92
Copy link

is there any fix on this? RN(0.44)

@nickkapoor
Copy link

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

@vladbars
Copy link

vladbars commented May 31, 2017

@nickkapoor , I replaced lines in android/settings.gradle, but the same error .

I solved it when downgrade react-native-maps to 0.13.0:
"react-native": "0.44.2",
"react-native-maps": "0.13.0"

But in this case android/settings.gradle lines are:
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android')

App was built, but MapView now is just white rectangle (

@decoderzhub
Copy link

decoderzhub commented Jul 30, 2017

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!

@abuammar
Copy link

i get this error

A problem occurred configuring project ':app'.

A problem occurred configuring project ':react-native-geocoder'.
failed to find target with hash string 'android-25' in: /Users/ws1/Library/Android/sdk

@mikehatch
Copy link

I was having this problem too:
Project with path ':react-native-maps' could not be found in project ':app'

The instructions here:

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

are actually wrong, they are missing the ':lib' element for the settings.gradle file

include ':react-native-maps**:lib**'

after adding the bold element above, it compiled successfully for me.

@yesersin
Copy link

after getting the error I re-installed "npm install react-native-maps --save-exact" fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests