[英]Mapbox: Cant add LocationLayer plugin in gradle
當我嘗試在我的gradle文件中包含LocationLayer插件時,出現錯誤。 交通插件和建築插件工作正常。
錯誤:
Failed to resolve: android.arch.lifecycle:extension:1.0.0-alpha3
Failed to resolve: android.arch.lifecycle:runtime:1.0.0-alpha3
的build.gradle:
repositories {
mavenCentral()
}
dependencies {
//Mapbox
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0@aar') {
transitive = true
}
//Navigation
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.3.1'
//Location layer
compile 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.1.0'
//Google Play Location Service
compile 'com.google.android.gms:play-services-location:11.0.2'
//Geolocation
compile 'com.mapbox.mapboxsdk:mapbox-android-ui:2.1.3'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espressocore:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
按照這些說明 ,您可以嘗試將maven { url 'https://maven.google.com' }
到repositories
並刷新Gradle嗎? 它基本上應該看起來像這樣:
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
}
不要忘記添加此依賴項:
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.10.0'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.