A problem occured while building application with \'react-native-maps\'
here is my setting.gradle file
include \':react-native-maps\'
project(\':reac
The error is in the dependecies in build.gradle file try with this:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.airbnb.android:react-native-maps:0.6.0'
}
Deleting the line compile project(':react-native-maps') the problem is resolved. This line is created by rnpm link but is a bug.
In MainActivity.java should be like this:
package com.yourapp; //<- put your app name
import com.facebook.react.ReactActivity;
import com.airbnb.android.react.maps.MapsPackage; //<- this line is 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 your app name
}
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new MapsPackage(this) //here you must be write the param this
);
}
}