异常 frameanimation ClassCastException/Android studio Error:Unable to start the daemon process

来源:互联网 发布:通信工程学java有用吗 编辑:程序博客网 时间:2024/04/28 04:59

1.ClassCastException: android.graphics.drawable.ColorDrawable

帧动画异常,奇怪的是在Android 4.0以上没有问题,

但是在Android 2.3时抛出异常:ClassCastException: android.graphics.drawable.ColorDrawable

提示异常代码行:AnimationDrawable ad=(AnimationDrawable) im.getDrawable();

弄了很久还是不行,最后发现把drawable文件名改短竟然就可以:

原文件名(frameanimation_jindutiao.xml)更改为(animation_jindu.xml


2.Error:Unable to start the daemon process

Error:Unable to start the daemon process.This problem might be caused by incorrect configuration of the daemon.For example, an unrecognized jvm option is used.Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.htmlPlease read below process output to find out more:-----------------------Error occurred during initialization of VMCould not reserve enough space for object heapError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.

AS启动APP异常解决办法:

1)Close Project

Configure -> Settings -> Gradle

Compilers VM Options 项 设置为:-Xmx512m

2)当前用户的.gradle文件夹下:C:\Users\Administrator\.gradle 设置gradle.properties,若无就新增文件,添加配置信息:org.gradle.jvmargs=-Xmx512m 

如果还是不行,有可能是同时开了eclipse和AS,关闭eclipse和模拟器并用真机测试一下就可以了。

3.Information:Gradle tasks [:app:assembleDebug] Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'

Android Studio:项目jar的重复引用: compile fileTree(dir: 'libs', include: ['*.jar'])  改为  provided fileTree(dir: 'libs', include: ['*.jar'])

并且删除对应引用如: compile files('libs/xx.jar')

更多:Android studio打开闪退、卡死问题,新建配置文件\android-studio\bin\studio.exe.vmoptions 或Help->Edit Custom VM Options

1 0