简体   繁体   English

添加的Mapbox导航包在gradle构建中显示错误。

[英]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.

相关问题 生成错误。 gradle(定义了多个dex文件) - Error in the build. gradle ( Multiple dex files define ) Gradle突然无法建立。 找不到Gradle DSL方法:“ android()” - Gradle suddenly will not build. Gradle DSL method not found: 'android()' Gradle构建显示错误:不支持的节点“项目” - Gradle build shows error: Unsupported node 'item' Unity 无法构建并显示 android 的 gradle 错误 - Unity fails to build and shows a gradle error for android android:Gradle Build中的导航抽屉错误 - android: Navigation Drawer error in Gradle Build RenderScript包不存在 - 尽管已添加到build.gradle中 - RenderScript package does not exist - although added to build.gradle Android,“XML文件中的错误:中止构建。” - Android, “Error in an XML file: aborting build.” 无法创建 .jar 文件。 使用 gradle 时出错,尤其是 ./gradlew build。 获取 java.lang.IllegalAccessError - Unable to create .jar file. Error while working with gradle, particularly ./gradlew build. getting java.lang.IllegalAccessError Android App不断在Build上崩溃。 调试器只显示很少 - Android App keeps crashing on Build. Debugger only shows little 多项目gradle构建错误:包不存在 - multiproject gradle build error: package does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM