我試圖建立UI測試我的Android Studio中的Android應用程序。問題是我無法運行它們。我收到消息:任務'app:prepareDebugAndroidTestDependencies'的執行失敗,我找不到它的內容。當我運行我的應用程序時,它啓動完美,但是當我嘗試運行測試時,它顯示提到的消息。我在下面的build.gradle是lsited:執行失敗的任務「應用:prepareDebugAndroidTestDependencies」
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "ba.etf.pkks.eldaralmin.libraryapp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven {
url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
// Supports Android 4.0.3 and later (API level 15)
compile 'com.embarkmobile:zxing-android-minimal:[email protected]'
// Supports Android 2.1 and later (API level 7), but not optimal for later Android versions.
// If you only plan on supporting Android 4.0.3 and up, you don't need to include this.
compile 'com.embarkmobile:zxing-android-legacy:[email protected]'
// Convenience library to launch the scanning and encoding Activities.
// It automatically picks the best scanning library from the above two, depending on the
// Android version and what is available.
compile 'com.embarkmobile:zxing-android-integration:[email protected]'
// Version 3.0.x of zxing core contains some code that is not compatible on Android 2.2 and earlier.
// This mostly affects encoding, but you should test if you plan to support these versions.
// Older versions e.g. 2.2 may also work if you need support for older Android versions.
compile 'com.google.zxing:core:3.0.1'
compile 'com.nononsenseapps:filepicker:2.1'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.google.code.gson:gson:1.7.2'
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support.test:rules:0.2'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
}
我運行/調試配置的測試是在下面的圖片:
http://pokit.org/get/?5b2509c64e5049b1b168c99b95313d5e.jpg
誰能幫我找出問題出在哪裏?
希望它可以幫助你。 – Evan
謝謝你的努力。一年多以前,我遇到了這個問題,並解決了這個問題,但沒有更新答案。 – alminh
你能投我的答案嗎?非常感謝。 – Evan