2016-03-10 20 views
12
./gradlew --parallel :app:assembleDebugTest 

當我上述命令在機器人工作室終端i得到這個錯誤運行。觀測包ID「構建的工具; 20.0.0」不一致的位置

錯誤 並行執行是一項孵化功能。 觀測包ID '構建的工具; 20.0.0' 不一致的位置 'SDK /構建工具/機器人-4.4W'(應爲 'SDK /構建工具/ 20.0.0')

搖籃文件 應用插件: '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:[email protected]' 
      androidTestCompile 'info.cukes:cucumber-picocontainer:1.2.0' 
    } 

參考:黃瓜link

+0

重新啓動Android Studio + Clean爲我工作 – RominaV

回答

10

我面臨着同樣的錯誤的Android測試昨日

卸載編譯工具:20爲我工作

回答這個issue是有幫助的

3

重命名文件夾

「SDK /構建工具/ Android的4.4W」 - >「SDK/build-tools/20.0.0「