gradle编译出错:Execution failed for task ':app:compileTestDebugJava'

简介:
随着更新gradle到1.12,出现问题。

貌似是gradle更新之后,里面的单元测试插件未更新。各种谷歌,找到了这个地址:https://github.com/robolectric/robolectric-gradle-plugin。于是换用原来的插件为这一个,修改如下(参照该项目的README):将以下内容:

(在TOOLS文件下的build.gradle)

    dependencies {  
        classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'  
    }  
修改为:
    dependencies {  
        classpath 'org.robolectric:robolectric-gradle-plugin:0.11.+'  
    }  

同时把

(在工程名下文件里的build.gradle)

apply plugin: 'android-test'

修改为

apply plugin: 'robolectric'

再运行Gradle clean build,成功。

目录
相关文章
|
1月前
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple
18 1
|
3天前
|
C# Android开发 开发者
Android gradle编译时字节码处理
Android gradle编译时字节码处理
11 1
|
1月前
|
Perl
pod spec lint编译时报The 'Pods-App' target has transitive dependencies that include static binaries错误问题
pod spec lint编译时报The 'Pods-App' target has transitive dependencies that include static binaries错误问题
25 1
|
1月前
|
Java Apache Maven
在STS里使用Gradle编译Apache POI5.0.0
在STS里使用Gradle编译Apache POI5.0.0
21 0
|
1月前
|
移动开发 jenkins 持续交付
jenkins编译H5做的android端编译卫士app记录
jenkins编译H5做的android端编译卫士app记录
21 0
|
1月前
|
缓存 Java 开发工具
Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’. Conflict with dependency ‘com.andr
Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’. Conflict with dependency ‘com.andr
15 1
|
1月前
|
Java 数据库 索引
GreenDao,clearIdentityScope报错Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Com
GreenDao,clearIdentityScope报错Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Com
20 1
|
1月前
Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicit
Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicit
74 0
|
1月前
|
Java Linux 开发工具
Azkaban【部署 01】Linux环境 CentOS Linux release 7.5.1804安装配置azkaban-3.70.0编译阶段(附安装包及gradle-4.6资源)
【2月更文挑战第4天】Linux环境 CentOS Linux release 7.5.1804安装配置azkaban-3.70.0编译阶段(附安装包及gradle-4.6资源)
64 1
|
1月前
|
开发框架 前端开发 算法
【Qt App 编译 】Qt Cmake 资源文件的加载:如何使用 CMakeLists.txt 文件和资源文件
【Qt App 编译 】Qt Cmake 资源文件的加载:如何使用 CMakeLists.txt 文件和资源文件
76 0