观察到的包 ID 'build-tools;20.0.0' 位置不一致

问题描述 投票:0回答:5
  ./gradlew --parallel :app:assembleDebugTest

当我在 android studio 终端运行上述命令时,我收到此错误。

错误 并行执行是一个正在孵化的功能。 在不一致的位置“sdk/build-tools/android-4.4W”中观察到包 ID“build-tools;20.0.0”(预期为“sdk/build-tools/20.0.0”)

Gradle 文件 应用插件:'com.android.application'

    android {
            compileSdkVersion 22
            buildToolsVersion '23.0.2'
            packagingOptions {
                    exclude 'LICENSE.txt'
            }
            defaultConfig {
                    applicationId "package"
                    minSdkVersion 15
                    targetSdkVersion 22
                    versionCode 1
                    versionName "1.0"
                    testApplicationId "package.test"
                    testInstrumentationRunner "package.test.Instrumentation"
            }
            buildTypes {
                    release {
                            minifyEnabled false
                            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                    }
            }
            sourceSets {
                    androidTest {
                            assets.srcDirs = ['src/androidTest/assets']
                    }
            }
            adbOptions {
                    timeOutInMs 60000 // set timeout to 1 minute
            }
    }

    dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
            compile 'com.android.support:appcompat-v7:22.2.1'
            compile project(':sdk')
            androidTestCompile('com.android.support.test:runner:0.4') {
                    exclude module: 'support-annotations'
            }
            androidTestCompile('com.android.support.test:rules:0.4') {
                    exclude module: 'support-annotations'
            }
            androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.1') {
                    exclude module: 'support-annotations'
            }

            androidTestCompile 'org.mockito:mockito-core:1.+'
            androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
            androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
            androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.1') {
                    exclude module: 'support-annotations'
                    exclude group: 'com.android.support', module: 'appcompat'
                    exclude group: 'com.android.support', module: 'support-v4'
                    exclude module: 'recyclerview-v7'
            }

            androidTestCompile 'info.cukes:cucumber-android:1.2.0@jar'
            androidTestCompile 'info.cukes:cucumber-picocontainer:1.2.0'
    }

参考:Cucumber Android 测试链接

android android-studio gradle cucumber android-gradle-plugin
5个回答
13
投票

我昨天遇到了同样的错误

卸载构建工具:20 对我有用

对此问题的回答很有帮助


5
投票
重命名文件夹

“sdk/build-tools/android-4.4W”->“sdk/build-tools/20.0.0”


1
投票
如果警告是不言自明的,你们为什么要把事情复杂化?

在不一致的位置“sdk/build-tools/android-4.4W”中观察到包 ID“build-tools;20.0.0”(预期为“sdk/build-tools/20.0.0”)

只需相应修改位置即可

sudo mv sdk/build-tools/android-4.4W sdk/build-tools/20.0.0
    

0
投票

可能您有两个版本相同的构建工具文件夹。在这种情况下,您可能有两个 20.0.0 版本的构建工具文件夹。删除其中任何一个即可解决问题。

否则,

您的构建工具会损坏。因此,删除该文件夹或使用 android studio 或 SDK 管理器卸载它,然后重新安装。


0
投票
使缓存失效并重新启动

© www.soinside.com 2019 - 2024. All rights reserved.