build->Rebuid-project

寻找错误根源:

报错里可以发现:

Resolved versions for app (26.1.0) and test app (27.1.1) differ

于是便查看app下build.gradle文件,发现并没有错误compileSdkVersion 为26,可是没有发现27.1.1版本的com.android.support:support-annotations。可是上述信息明显是版本冲突,于是在external library中寻找

发现了依赖包冲突。于是根据自己的编译版本删除多余的包27.1.1(笔者compileSdkVersion 为26),rebuild后问题解决。可是重启以后问题还会复现。于是上网继续寻找方法。再尝试了很多方法后,找到了一个方法解决了该问题。解决方法如下:

在app下的build.gradle文件中的dependences {}中添加如下代码:

androidTestCompile('com.android.support:support-annotations:26.1.0') {
force = true
}

添加后dependences中结构类似

dependencies {
androidTestCompile('com.android.support:support-annotations:26.1.0') {
force = true
}
...
}

AS报错:Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.and的更多相关文章

  1. Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency

    错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...

  2. Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app

    出现的问题: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...

  3. Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency

    Error : Execution failed for task ’ :app: preDebugAndroidTestBuild’.Conflict with dependency ‘com.an ...

  4. 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决

    在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'.&g ...

  5. Android studio中的一次编译报错’Error:Execution failed for task ':app:transformClassesWithDexForDebug‘,困扰了两天

    先说下背景:随着各种第三方框架的使用,studio在编译打包成apk时,在dex如果发现有相同的jar包,不能创建dalvik虚拟机.一个apk,就是一个运行在linux上的一个虚拟机. 上图就是一直 ...

  6. 关于android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法

    Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 2018年 ...

  7. Android Studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'.彻底解决的方法以及修改AScompileSDKVersion

    Error Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency ...

  8. Error:Execution failed for task ':app:preDebugAndroidTestBuild'.错误解决

    在新建布局文件的时候,页面显示: design editor is unavailable until a successful build(设计编辑器不可用,直到成功创建.) 细看下面还有一行错误: ...

  9. android studio新建项目时出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'.

    android studio更新后创建新项目时出现以下错误 可以用Build->Rebuild Project解决,但这个方法只是临时的,重新打开项目还是会报错 所以用另一种方法: 在app下的 ...

随机推荐

  1. java中堆栈的一些理解备忘

    堆:用来存放对象的信息,同一个类存放各自的成员变量,共享对象的方法. 栈:用来保存局部变量的值,包括基本数据类型的值.保存类的实例(堆区对象的引用).保存加载方法的帧. 常量池:包含了一个类型所有的对 ...

  2. Subway POJ - 2502 spfa

    #include<cstdio> #include<cmath> #include<cstring> #include<cstring> #includ ...

  3. eclipse配置tomcat,并部署一个Java web项目到tomcat上

    引用链接:https://blog.csdn.net/cincoutcin/article/details/79408484 eclipse配置tomcat 1.windows——preference ...

  4. Pytest学习7-参数化

    在测试过程中,参数化是必不可少的功能,本文就讨论下pytest的几种参数化方法 @pytest.mark.parametrize:参数化测试函数 1.内置的pytest.mark.parametriz ...

  5. Wannafly Camp 2020 Day 6M 自闭 - 模拟

    按题意模拟,又乱又烦,没什么可说的 #include <bits/stdc++.h> using namespace std; #define int long long int n,m, ...

  6. 配置maven时,报JAVA_HOME错误

    其实原因很简单,是之前java的jdk配置不合规范! 一.我是win10系统. 二.我的java jdk放在D盘,环境变量里,JAVA_HOME是D:\Program Files\Java\jdk1. ...

  7. sencha Architect 3.2及以下版本都适用的 破解方法

    找到 没有的话 打开隐藏文件夹 C:\Users\ll\AppData\Local\Sencha\Sencha Architect 3.2 用编辑器 打开user.license 把 Print 修改 ...

  8. C#中常见的winform控件命名规范 转

    我们知道Button 常常简称为btn,那么Winform中的其它控件呢,这篇文章在C#的winform控件命名规范 的基础上对一些控件的名称的简称进行了整理. 1. 标准控件 NO. 控件类型简写 ...

  9. Oracle体系结构中基本概念,数据库

    在Oracle体系结构中包含了基本概念即Oracle数据库与实例,如果你想要了解Oracle体系结构的话,你就必须要了解这两个基本的概念,以下是文章的具体介绍,望你浏览完以下的内容会有所收获. 数据库 ...

  10. 连续张量理解和contiguous()方法使用,view和reshape的区别

    连续张量理解和contiguous()方法使用,view和reshape的区别 待办 内存共享: 下边的x内存布局是从0开始的,y内存布局,不是从0开始的张量 For example: when yo ...