继续another question,已解决。
我正在通过Pluralsight的Start Developing for Android课程。我们即将添加测试。说明说要将androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
添加到build.gradle
文件(app
模块中的文件)。
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.3'
defaultConfig {
applicationId 'com.sqisland.android.hello'
minSdkVersion 1
targetSdkVersion 24
versionCode 1
versionName '1.0.0'
}
dependencies {
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
}
}
当我同步构建时,我可能会出错:
Error:Execution failed for task ':app:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 8 declared in library [com.android.support.test.espresso:espresso-core:2.2.2] F:\BanksySan\Development\PluralSight\android-hello-world\app\build\intermediates\exploded-aar\com.android.support.test.espresso\espresso-core\2.2.2\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.test.espresso" to force usage
我应该使用建议的修复程序吗?目前,我认为我更有可能在某个地方错过了一个图书馆。
在Andy的建议下面
我已将块移到外面,错误是:
Error:Execution failed for task ':app:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 8 declared in library [com.android.support.test.espresso:espresso-core:2.2.2] F:\BanksySan\Development\PluralSight\android-hello-world\app\build\intermediates\exploded-aar\com.android.support.test.espresso\espresso-core\2.2.2\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.test.espresso" to force usage
答案 0 :(得分:1)
将dependencies
阻止移出android
阻止,并将minSdkVersion
提升至至少8
:
android {
minSdkVersion: 8
//...
}
dependencies {
// ....
}