Android AS升级3.1 编译报错:The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin.
AndroidStudio升级到3.1后编译报错:The SourceSet ‘instrumentTest’ is not recognized by the Android Gradle Plugin.
项目中 gradle 配置
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
原因
是这里出问题了 instrumentTest.setRoot(‘tests’) ,你可能在升级 Android Studio 时更新了项目的 gradle 配置,这里的配置中 instrumentTest 已被弃用,不适用于现在的 gradle 版本。
解决办法
用 androidTest 替换 instrumentTest,编译运行即可。
Android AS升级3.1 编译报错:The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin.的更多相关文章
- cocos2d-x在android中响应返回键编译报错的bug分析
先看一段代码如何在Android中加入返回按键的响应 <span style="font-size:18px;">自己派生CCKeypadDelegate的子类,然后注 ...
- RK3399 Android 7.1 删除repo后编译报错
CPU:RK3399 系统:Android 7.1 瑞芯微使用的是 repo 来进行代码管理,但我们需要用 git 来管理,所以就删除了 repo,但是编译就报错,如下:Server is alrea ...
- ios 12 xcode10 新升级的编译报错libstdc++.6.0.9 Multiple commands produce
问题一 编译报错 Showing Recent Messages :-1: Multiple commands produce '/Users/duning/Library/Developer/Xco ...
- 一些webpack常见编译报错的解决方案
重新安装依赖可以解决80%的webpack编译报错问题. rm -rf node_modules rm package-lock.json npm cache clear --force npm in ...
- 使用C#模拟Outlook发送邮件,代码编译报错
添加OutLook API using OutLook = Microsoft.Office.Interop.Outlook; 发送邮件方法 public void SendEmail() { Out ...
- Android Studio使用org.apache.http报错
Android Studio使用org.apache.http报错需要加上这句话:useLibrary 'org.apache.http.legacy'
- cordova编译报错:Execution failed for task ':processDebugResources'
cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...
- 编译报错dereferencing pointer to incomplete type
关于编译报错“dereferencing pointer to incomplete type... 多是没找到结构体的定义,可以在本地复制其定义试试. 参考: http://my.oschina.n ...
- Maven-010-maven 编译报错:Failure to ... in ... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced.
今晚在编译 maven 项目的时候,命令行报错,出现 Failure to ... in ... 类似错误,详细的错误信息如下所示: [INFO] -------------------------- ...
随机推荐
- Codeforces Round #533 (Div. 2)题解
link orz olinr AK Codeforces Round #533 (Div. 2) 中文水平和英文水平都太渣..翻译不准确见谅 T1.给定n<=1000个整数,你需要钦定一个值t, ...
- .NET Services Stack笔记之手写版
- StackOverflow
stackoverflow栈溢出 stacker栈式存储器 signup注册 signin登陆 inbox收信信箱 verify 核实 otherwise另外的 noted说明 (就是说有明文指出 ...
- Windows任务计划创建计划,定时执行PowerShell命令
[环境介绍] 操作系统:Windows Server 2012 R2,64位操作系统 PowerShell版本:PowerShell 1.0 脚本位置:C:\BackUp.ps1 启动目录:C:\Wi ...
- NowCoder数列(矩阵快速幂变式)
时间限制 3000 ms 内存限制 32768 KB 代码长度限制 100 KB 题目描述 NowCoder最近在研究一个数列: * F(0) = 7 * F(1) = 11 * F(n) = F(n ...
- Request库基本使用
基本实例 import requests url= 'https://www.baidu.com/' response = requests.get(url) print(type(response) ...
- 编译安装libimobiledevice
在windows上大家可以使用iTunes来与iPhone进行通信,但是Linux上没有这类的官方软件,所以一些爱好者就破解了iTunes的通信协议,然后在Linux上实现了该协议,也就是libimo ...
- java——数组栈 ArrayStack
栈的应用: undo操作-编辑器 系统调用栈-操作系统 括号匹配-编译器 以下是动态数组实现的数组栈: 定义动态数组: package Date_pacage; public class Array& ...
- vue-cli构建的项目打包出现里面的js,css缺少dist路径
转载 https://www.cnblogs.com/wanf/p/7871787.html
- vue+iview中的table表格导出excel表格
一.iveiw框架中table中有exportCsv()方法可以导出.csv后缀文件,类似于excel文件,但是并不是excel文件. 二.实现table表格导出excel文件利用Blob.js 和 ...