Android studio 编译出现的问题记录
1、app:transformClassesWithJarMergingForDebug'.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: > android/support/v7/cardview/BuildConfig.class
解决办法:
1、在 Terminal 输入:./gradlew clean
2、在菜单中选择: Build -> Clean Project
2、Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)
<a href="openFile:/Users/shenjiaqi/Documents/sjq/annotation/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)">Show Details</a>
解决办法:确保在 app 的 build.gradle 中包含下面语句:
repositories {
google()
jcenter()
maven {url 'https://jitpark.io/'}
}
完整版如下:
apply plugin: 'com.android.application' android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.sjq.recycletest"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} repositories {
google()
jcenter()
} sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'src/main/aidl']
resources.srcDirs = ['src/main/java', 'src/main/aidl']
aidl.srcDirs = ['src/main/aidl']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
}
} dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
}
3、注解报错Annotation processors must be explicitly declared now.
解决办法:
在app的build中
android {
...
defaultConfig {
...
//添加如下配置就OK了
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
...
}
Android studio 编译出现的问题记录的更多相关文章
- android studio 导入第三方库的记录
android studio 导入第三方库的记录.jar包 和 库 一.jar包 1.jar包的话很简单,首先换成project模式,将你要用的jar包复制到lib下面.如图 2.然后右键选择Add ...
- android studio 编译加速
1. http://www.52codes.net/article/658.html 2.http://my.oschina.net/sammy1990/blog/388846 3.http://st ...
- 手把手图文并茂教你用Android Studio编译FFmpeg库并移植
转载请把头部出处链接和尾部二维码一起转载,本文出自逆流的鱼yuiop:http://blog.csdn.net/hejjunlin/article/details/52661331 之前曾写过一篇&l ...
- Android studio 编译失败Error:Could not read entry ':app:processDebugManifest' from cache taskArtifacts.b
Android studio 编译失败 Error:Could not read entry ':app:processDebugManifest' from cache taskArtifacts. ...
- 【Android】Android studio 编译问题:finished with non-zero exit value 2
1.Android studio 编译问题:finished with non-zero exit value 2 问题: Error:Execution failed for task ':andr ...
- 我的Android进阶之旅------>解决Android Studio编译后安装apk报错:The APK file does not exist on disk
1.错误描述 今天用Android Studio编译应用后安装APK的时候,报错了,错误如下所示: The APK file build\outputs\apk\OYP_2.3.4_I2Base_64 ...
- android studio编译包真机安装失败解决方案记录
Android studio升级到3.0之后,编译的APK文件无法在真机上安装,提示安装失败,最开始以为是API版本过高,与手机的版本不兼容,然后降低API,结果依然是安装失败. 然后连接手机,直接调 ...
- windows android studio 编译Jni动态库
项目需要,折腾了半天搞定windows android studio环境编译Jni动态库,现记录下来. 准备安装环境: 1. android studio 下载地址是http://www.androi ...
- Android Studio编译OsmAnd出现警告:GeoPointParserUtil.java使用或覆盖了已过时的 API。有关详细信息请使用-Xlint:deprecation重新编译
[背景] 之前折腾: [记录]Android Studio中导入OsmAnd并编译 期间,遇到了编译警告: 1 2 3 4 5 :OsmAnd-java:compileJava 注: E:\crifa ...
随机推荐
- ASP.NET代码调用SQL Server带DateTime类型参数的存储过程抛出异常问题
ASP.NET代码调用SQL Server带DateTime类型参数的存储过程,如果DateTime类型参数的值是'0001/1/1 0:00:00'时,就会抛出异常“Message: SqlDate ...
- Runnable与Callable区别
相同点: 两者都是接口:(废话) 两者都可用来编写多线程程序: 两者都需要调用Thread.start()启动线程: 不同点: 两者最大的不同点是:实现Callable接口的任务线程能返回执行结果:而 ...
- C++: find()函数的注意事项
头文件: <algorithm> iterator find(iterator it1, iterator it2, &T);
- eclipse和sublime3打开freemarker(.ftl)文件
1.eclipse如何打开freemarker? https://jingyan.baidu.com/article/49ad8bce5ea95d5834d8fa9e.html 2.sublime3如 ...
- Runtime "Apache Tomcat v6.0 (3)" is invalid. The JRE could not be found. Edit the server and change the JRE location解决方案
使用eclipse,启动Tomcat时出现The JRE could not be found ,Edit server and change teh JRE location的错误提示! 原因:重装 ...
- Robust Influence Maximization
一. 研究背景 在社会和经济网络中,影响最大化问题在过去十年中得到广泛的研究,由于其广泛应用于病毒式营销[1,2],突破检测[3],谣言监测[4]等.例如公司可以通过向初始用户(称为种子)发送免费 ...
- Pip无法卸载某些包:Cannot uninstall 'PyYAML'.
查找了很多资料,最终还是手动删除吧: 注意如果你有火萤酱或everything等外部索引的,来搜索如图PyYAML的进行删除,可能删不干净 建议最后在你的anaconda路径下或者python路径下在 ...
- Spring Boot使用过滤器和拦截器分别实现REST接口简易安全认证
本文通过一个简易安全认证示例的开发实践,理解过滤器和拦截器的工作原理. 很多文章都将过滤器(Filter).拦截器(Interceptor)和监听器(Listener)这三者和Spring关联起来讲解 ...
- 如何利用sqoop将hive数据导入导出数据到mysql
运行环境 centos 5.6 hadoop hive sqoop是让hadoop技术支持的clouder公司开发的一个在关系数据库和hdfs,hive之间数据导入导出的一个工具. 上海尚学堂 ...
- Java面试题精选,大型网站系统架构你不得不懂的10个问题
作者:JavaGuide(公众号) 下面这些问题都是一线大厂的真实面试问题,不论是对你面试还是说拓宽知识面都很有帮助.之前发过一篇8 张图读懂大型网站技术架构 可以作为不太了解大型网站系统技术架构朋友 ...