评估MapboxGLManager.mapStyles

ESe*_*sei 7 javascript android mapbox reactjs react-native

尝试在我的React-Native应用程序上安装Mapbox(在此处找到)时,我一直收到此错误. 错误

我的文件如下:

的build.gradle

settings.gradle

MainActivity.java

AndroidManifest.xml中

G. *_*ide 0

在您的 build.gradle 和 settings.gradle 中,您添加了错误的行:

构建.gradle

dependencies {
    compile project(':react-native-mapbox-gl') // <==== remove this line
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"
    compile project(':reactnativemapboxgl') // <=== missing this line
}
Run Code Online (Sandbox Code Playgroud)

设置.gradle

删除这两行...

include ':react-native-mapbox-gl'
project(':react-native-mapbox-gl').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapbox-gl/android')
Run Code Online (Sandbox Code Playgroud)

...并将它们替换为:

include ':reactnativemapboxgl'
project(':reactnativemapboxgl').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapbox-gl/android')
Run Code Online (Sandbox Code Playgroud)