Execution failed for task ':app:preDebugAndroidTestBuild

简介

当我们平常运行AS编译器,发生如下错误

Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’.
Conflict with dependency ‘com.android.support:support-annotations’ in project ‘:app’. Resolved versions for app (22.1.0) and test app (25.4.0) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

发生这类型的错误,是当我们修改了.build中的compileSdkVersion,产生所依赖的dependency与当前版本不一致导致的。

解决

build->Rebuid-project

发布了29 篇原创文章 · 获赞 57 · 访问量 16万+
展开阅读全文

新手错误Error:Execution failed for task

08-06

今天弄了一个直播sdk下来测试,在新创建的一个空项目里引入了sdk包,没想到更新完gradle,就报出了这个错误,完整如下: Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple errors, see logs 还有相关的信息提示:Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :liveRtmpPushSDK:generateDebugSources, :liveRtmpPushSDK:generateDebugAndroidTestSources, :liveRtmpPushSDK:mockableAndroidJar, :liveRtmpPushSDK:prepareDebugUnitTestDependencies] 以下是空项目的build.gradle信息: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "26.0.1" defaultConfig { applicationId "com.example.lin.videotest" 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.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile project(':liveRtmpPushSDK') } 如下是直播sdk的build.gradle信息 apply plugin: 'com.android.library' android { compileSdkVersion 19 buildToolsVersion '25.0.0' defaultConfig { minSdkVersion 19 targetSdkVersion 19 // ndk { // moduleName "fdk-aac" // cFlags "-IE:/AS_code/LiveRtmpPushSDKDemo/liveRtmpPushSDK/src/main/jni -IE:/AS_code/LiveRtmpPushSDKDemo/liveRtmpPushSDK/src/main/jni/include -IE:/AS_code/LiveRtmpPushSDKDemo/liveRtmpPushSDK/src/main/jni/svc" // ldLibs "log", "z", "stdc++" // } } sourceSets.main { jni.srcDirs = [] jniLibs.srcDir 'src/main/libs' } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:18.0.0' } 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览