1.Error:com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
解决方法:在build中加入
implementation "com.google.guava:guava:23.0-android"
2. com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
解决方法:原因是方法数超出限制导致的 在app的build.gradle文件中添加:
defaultConfig{
multiDexEnabled true
}
3. Could not find method google() for arguments [] on repository container. gradle升级到最新版本可解决。
4.app:externalNativeBuildCleanDebug 因版本不支持cmake 删除
5.eclipse 转 android studio Could not resolve all files for configuration ':classpath'.
在build.gradle中 添加
google() 如:
buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } } allprojects { repositories { google() jcenter() } }
6.Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
下载过程中断连导致gradle出错,需要到对应目录删除重新下载。
扫描二维码关注公众号,回复:
140789 查看本文章
7.Android Studio Error—Gradle: 错误:编码 GBK 的不可映射字符的
解决办法:
在项目下的build.gradle下添加以下代码即可解决
tasks.withType(Compile) { options.encoding = "UTF-8" }
8.Android dependency has different version for the compile and runtime
因为同一个build依赖两个不同版本的jar包导致,查询一下各个依赖的版本和api 、implementation的区别。