[英]Mapbox navigation package when added shows error in gradle build.
I am creating a blank project in which I add mapbox navigation package compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.6.3'
in the gradle file. 我正在创建一个空白项目,在其中添加了mapbox导航包,在gradle文件中添加了compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.6.3'
。 It shows error in appcompat file like this:- 它在appcompat文件中显示错误,如下所示:-
Error:Failed to resolve: com.android.support:appcompat-v7:26.1.0
eventhough I use different version of Appcompat file. 即使我使用Appcompat文件的不同版本。 Before adding navigation package, everything was fine. 在添加导航包之前,一切都很好。 Can someone please help me to find out this weird error. 有人可以帮我找出这个奇怪的错误。
Here is my app's gradle file: 这是我的应用程序的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.aadhilahmed.test7"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.6.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Specify: 指定:
compile ('com.mapbox.mapboxsdk:mapbox-android-navigation:0.6.3') {
transitive = false;
}
Try this.Starting from version 26 of support libraries make sure that the repositories section includes a maven section 从支持库的版本26开始,请确保存储库部分包括maven部分
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For Gradle build tools plugin version 3.0.0 对于Gradle构建工具插件版本3.0.0
allprojects {
repositories {
jcenter()
google()
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.