Error:Execution failed for task ':app:preDebugAndroidTestBuild'.错误解决
在新建布局文件的时候,页面显示:
design editor is unavailable until a successful build(设计编辑器不可用,直到成功创建。)
细看下面还有一行错误:
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.(':app:preDebugAndroidTestBuild'任务执行失败)
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
( ':app'.项目中的 'com.android.support:support-annotations' 有冲突,应用是26.1.0,测试应用是27.1.1。)
解决方法:
在build.gradle的文件中加入两行代码:
implementation'com.android.support:appcompat-v7:27.1.1'
androidTestImplementation'com.android.support:support-annotations:27.1.1'
同时更正build.gradle中的compileSdkVersion和targetSdkVersion版本为27:
android {
compileSdkVersion27
defaultConfig {
applicationId"com.example.culif.activitytest"
minSdkVersion27
targetSdkVersion27
versionCode1
versionName"1.0"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
}
如果出现找不到27.1.1的错误点一下install就可以
作者:西柚读书
链接:https://www.jianshu.com/p/efbc0a23d942
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.错误解决的更多相关文章
- 关于android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法
Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 2018年 ...
- Android Studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'.彻底解决的方法以及修改AScompileSDKVersion
Error Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency ...
- Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency
错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...
- 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 ...
- Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency
Error : Execution failed for task ’ :app: preDebugAndroidTestBuild’.Conflict with dependency ‘com.an ...
- Android Studio3.0 Error:Execution failed for task ':app:javaPreCompileDebug' 错误
Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be expli ...
- android studio新建项目时出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
android studio更新后创建新项目时出现以下错误 可以用Build->Rebuild Project解决,但这个方法只是临时的,重新打开项目还是会报错 所以用另一种方法: 在app下的 ...
- AS报错:Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.and
build->Rebuid-project 寻找错误根源: 报错里可以发现: Resolved versions for app (26.1.0) and test app (27.1.1) d ...
- Android Studio Error:Execution failed for task ':app:compileDebugJavaWithJavac' 根本解决方法
造成这种异常的原因有很多.具体的还是要去终端编译,查看到底是什么地方出错了,然后具体问题具体分析. 终端进入项目的根目录,然后输入命令 gradlew compileDebugJavaWithJava ...
随机推荐
- 获取dictionary 值连续相同的索引,
; i < ;) { , i]; var rangType = companyScheme[i]; string txtCell = ""; switch (rangType ...
- (转) mysql之status和variables区别及用法详解
原文:http://blog.csdn.net/andyzhaojianhui/article/details/50052117
- ASP.NET站点Windows身份验证集成AD域,非LDAP
站点集成AD域验证 服务器机器入域 计算机右键属性-->“更改设置”-->“更改”-->填写所属域,确认后重启机器生效. 部署测试站点,localhost.ip.域名三种方式登录效果 ...
- 【数组】Sort Colors
题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same ...
- sqldeveloper的安装及其使用教程
1.安装 下载地址:http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index-098778.htm ...
- Python -- Gui编程 -- Tkinter的使用 -- 基本控件
1.按钮 tkBtton.py import tkinter root = tkinter.Tk() btn1 = tkinter.Button(root, anchor=tkinter.E,\ te ...
- 生成类似于MongoDB产生的ObjectId
package com.jt.boot.utils; import com.google.common.base.Objects; import java.net.NetworkInterface; ...
- 简单canvas刮刮乐
好久没玩canvas了,随便写点效果玩玩.要开始重新拾起这门牛x的技术了,工作中不一定能用得上,以后说不定就能发挥用处了. <!DOCTYPE html> <html lang=&q ...
- CSS Sprites(CSS精灵) 的优缺点
CSS Sprites 的优点: 1.减少图片的字节 2.减少了网页的http请求,从而大大的提高了页面的性能 3.解决了网页设计师在图片命名上的困扰,只需对一张集合的图片上命 ...
- 关于around_filter 的调用
def call_filter(chain, index) return (performed? || perform_action_without_filters) if index >= ...