当我添加Mapbox导航API版本时。 0.20.0到我的项目中,构建,然后添加一些导航代码,MapBox地图在地图活动开始时崩溃。
我尝试删除导航代码,运行应用程序,仍然失败,然后删除了依赖项和maven repo(mapbox),将两者都删除后,地图显示了。但是,我想向我的应用程序添加一些导航功能。
我的依赖关系:
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.prajoshwas.capstone"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-location:15.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'de.hdodenhof:circleimageview:1.2.1'
api 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
api 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'org.jsoup:jsoup:1.11.2'
implementation 'com.google.firebase:firebase-auth:16.0.1'
// Testing
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
//MapBox Dependencies
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:3.2.0'
// Mapbox Services SDK dependency to retrieve direction routes
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:3.2.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:3.2.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-geojson:3.2.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places:0.6.0'
// Mapbox Buildings Plugin for showing and customizing 3D building extrusions
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-building:0.3.0'
}
我删除了导航API,所以它不在上面,可能是有关为什么崩溃的原因以及需要做些什么或为了添加导航功能并避免崩溃而错过的事情的解释。谢谢!