记录Android studio使用过程中遇到的问题

转载请标明出处:http://blog.csdn.net/u013254166/article/details/79287971

本文出自: rhino博客 

1. com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:Process'command'/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
解决方法:
在工程的gradle中设置,可以支持超过65k的方法数
defaultConfig {        
    // Enabling multidex support.
    multiDexEnabled true
}

2. com.android.build.api.transform.TransformException: java.util.zip.ZipException: 
解决方法:
重复包,把对应重复的删除即可一般为v4冲突

3. Error:Execution failed for task ':transformClassesWithDexForArmv7Release'.> com.android.build.api.transform.
TransformException:com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
解决:
dexOptions {    
    javaMaxHeapSize "4g"
}

4. FATAL EXCEPTION: main
Process: com.wanda.property_client, PID: 11910
java.lang.NoClassDefFoundError: org.apache.cordova.PluginEntry
导致4.4系统安装程序直接崩掉
解决:
在application中加入:
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);    
    MultiDex.install(this);
}

5. Unable to create Debug Bridge: Unable to start adb server: error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 (10048)
error: unknown host service
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
解决:
根据提示查看adb的端口号5037被谁占用
通过 netstat -aon|findstr "5037" 找出相应的pid号,
再通过任务管理器找到相应pid号的进程,然后将其结束,最后重启adb,adb start-server

6. Error:(43, 24) 错误: -source 1.6 中不支持 multi-catch 语句
(请使用 -source 7 或更高版本以启用 multi-catch 语句)
Error:(149, 42) 错误: -source 1.6 中不支持二进制文字
(请使用 -source 7 或更高版本以启用二进制文字)
解决:
根据提示选择7

7. 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 https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap
解决:

检查gradle.properties相关org.gradle.jvmargs设置

8.Error:(9084) style attribute '@android:attr/windowExitAnimation' not found.
解决:
在Project/gradle.properties中添加 android.enableAapt2=false





猜你喜欢

转载自blog.csdn.net/u013254166/article/details/79287971