android studio使用部分报错处理

 

Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key key0 from store "xxx.jks": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

 

 

app打包时 Direct local .aar file dependencies are not supported when building an AAR

创建文件夹LibTest:将aar包添加到目录;添加build.gradle文件

 

configurations.maybeCreate("default")
artifacts.add("default", file('xxx.aar'))

 

 

在settings.gradle中引用:

include ':LibTest'

 

引用:

api project(path: ':LibTest')//implementation 

 

 

android resource linking failed

清理idea/build等无效后发现module里引用的appcompat等包版本不一致。改后正常编译

 

 Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option

 gradle添加

android{
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
        freeCompilerArgs = ['-Xjvm-default=all-compatibility']//添加
    }
}

 

Build was configured to prefer settings repositories over project repositories but repository ‘Gradle Libs’ was added by unknown code

gradle  7.1.2

注释掉settings.gradle里的

epositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)

 

Illegal char <:> at index 49: .app-mergeDebugResources-29:/values/values.xml

检测依赖和第三方依赖的版本等

 

log乱码

studio 安装目录下 bin /studio64.exe.vmoptions    添加-Dfile.encoding=UTF-8    重启studio

 

android studio 导入项目时Error:SSL peer shut down incorrectly

今天导入一个项目到studio,显示在下载一个一个1.1.0-rc4的东西。

 

过了一会报了这个错,网上搜了下说是

Android SDK Manager下载SDK报错:Download interrupted: SSL peer shut down incorrectly

还需要设置一些文件什么的,看着挺麻烦的

然后我到这里看了下

对照着自己能正常运行的项目改了一下就好了,也可以在gradle里改

android studio编译时Error:(6, 34) 错误: 程序包android.support.annotation不存在,或者是读取不到xxx版本的annotation

这个出现的原因应该比较少,纯粹个人手贱,鼓捣坏了。fx看了下,大部分是说依赖包的问题,或者是版本不兼容的问题之类的。那些去查就好了,这里只是针对我自己的。网速不好的话,不建议

如下图,把这两个删掉,然后重新下载就ok了。

 

clean的时候出现如下错误Error:Execution failed for task ':app:clean'.> Unable to delete file: E:\caibao\dangkelanqiu\Dunk\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\jars\classes.jar

或者是v7/appcompat/R$anim.class的错误

解决方法:打开电脑的任务管理器,找到如下进程,结束掉,再次clean就ok了

或者这样也可以

运行时,出现非零值退出值1的错误,

clean Project就好了

如果是values 2的话,应该就是有重复导入的包了

之前项目好好的,结果突然就报错了-gradle升级了

Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "aed79d567e57792ed352e708d2b7ca891ff897c6"

<a href="fixGradleElements">Fix plugin version and sync project</a><br><a href="openFile:E:\xxx\xxx\xxxx\xxx\app\build.gradle">Open File</a>

classpath 'com.android.tools.build:gradle:2.0.0-alpha1'  //项目里的
(1)、classpath 'com.android.tools.build:gradle:2.0.+'        //改成这个

 

(2)、网址看最新的插件版本https://jcenter.bintray.com/com/android/tools/build/gradle/

把gradle的版本改成那个最新的就行

(3)、有关gradle-wrapper.properties。E:\xxx\xxx\gradle\wrapper\gradle-2.10-all.zip的错误

 
Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run 
 因为他要gradle的alpha版 ,Instant Run必须是alpha版的才能用 ,可以不用他,把instant  run关掉
 
java.lang.RuntimeException: A TaskDescription's primary color should be opaque
 

对比一下就可以发现是主题的颜色值格式设置的不对

 

java.lang.NoSuchFieldError: No static field emojiView of type I in class Lcom/**/**R$id

这个问题是由于主项目覆盖了库项目的xml所致,如果主项目中的某个xml里定义了一个跟库项目中的xml同名的xml,那么库中的xml将会被覆盖。这里的覆盖意思是,编译后只有主项目中的xml以及R.id,完全没有库项目的影子。所以才会有NoSuchFieldError的错误。

这个错误不会在编译的时候提示,算得上一个陷阱了。

解决方法很简单,删除主项目中的xml,整个项目只保留一份xml即可。
其他参考:http://blog.csdn.net/zgf1991/article/details/47106235

 

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

方法数越界,可以参考Multidex解决方法数越界

 

com.android.ddmlib.SyncException: No space left on device

模拟器里的无用应用,demo卸载几个。

 

Unknown host 'd29vzk4ow07wi7.cloudfront.net'. You may need to adjust the proxy settings in Gradle.

  参考:https://www.jianshu.com/p/bfaa9dc6a7d6

 

Could not download javaparser-core.jar (com.github.javaparser:javaparser-core:3.2.8): No cached version available for offline mode 

关掉

 

Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.4.0): No cached version available for offline mode 

File => Settings => Build, Execution, Deployment => Build Tools => Gradle => Offline Work  然后重启studio

 

 

posted @ 2016-01-26 14:53  西瓜皮不甜  阅读(12090)  评论(0编辑  收藏  举报