android - cannot evaluate module 'react-native-maps' : Configuration with name 'default' not found -


a problem occured while building application 'react-native-maps'

here setting.gradle file

include ':react-native-maps' project(':react-native-maps').projectdir = new file(rootproject.projectdir, '../node_modules/react-native-maps/android') 

dependencies of android/app/build.gradle file

dependencies {     compile project(':react-native-maps')     compile filetree(dir: "libs", include: ["*.jar"])     compile "com.android.support:appcompat-v7:23.0.1"     compile "com.facebook.react:react-native:+"  // node_modules     compile 'com.airbnb.android:react-native-maps:0.6.0' } 

here mainactivity.java file updated mapspackage()

protected list<reactpackage> getpackages() {         return arrays.<reactpackage>aslist(             new mainreactpackage(),             new mapspackage()         );     } 

error coming:

js server running. building , installing app on device (cd android && gradlew.bat install debug...

failure: build failed exception.

  • what went wrong: problem occurred configuring project ':app'.

    cannot evaluate module react-native-maps : configuration name 'default' n ot found.

  • try: run --stacktrace option stack trace. run --info or --debug option more log output.

build failed

total time: 13.479 secs not install app on device, read error above details.

i have referred procedure mention in given link https://github.com/lelandrichardson/react-native-maps/blob/master/docs/installation.md

i have seen https://github.com/lelandrichardson/react-native-maps/issues/288 not resolve error

please in advance

the error in dependecies in build.gradle file try this:

dependencies {     compile filetree(dir: "libs", include: ["*.jar"])     compile "com.android.support:appcompat-v7:23.0.1"     compile "com.facebook.react:react-native:+"  // node_modules     compile 'com.airbnb.android:react-native-maps:0.6.0' } 

deleting line compile project(':react-native-maps') problem resolved. line created rnpm link bug.

in mainactivity.java should this:

package com.yourapp;   //<- put app name import com.facebook.react.reactactivity; import com.airbnb.android.react.maps.mapspackage; //<- line important import com.facebook.react.reactpackage; import com.facebook.react.shell.mainreactpackage; import java.util.arrays; import java.util.list; public class mainactivity extends reactactivity {   @override   protected string getmaincomponentname() {     return "yourapp"; //<- put app name   }   @override   protected boolean getusedevelopersupport() {     return buildconfig.debug;   }   @override   protected list<reactpackage> getpackages() {     return arrays.<reactpackage>aslist(     new mainreactpackage(),     new mapspackage(this) //here must write param     );   } } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -