#Android错误总结
博客撰写人:It一zhai男
转载请标明地址:http://blog.csdn.net/u013293125/article/details/52636929
最近一直想将自己编写程序时遇到的错误总结一下,但因为诸多原因一直都没付诸行动。这个错误总结本人将会不断更新,以下错误是本人遇到并解决了,编程工具Android studio 2.0。
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Administrator\AppData\Local\Android\sdk1\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find com.android.support:appcompat-v7:23.4.0.
Required by:
xcmg:app:unspecified
> Could not find com.google.android.gms:play-services-appindexing:8.1.0.
Required by:
xcmg:app:unspecified
> Could not find com.android.support:support-v4:23.4.0.
Required by:
xcmg:app:unspecified
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find com.android.support:appcompat-v7:23.4.0.
Required by:
xcmg:app:unspecified
> Could not find com.android.support:support-v4:23.4.0.
Required by:
xcmg:app:unspecified
> Could not find com.android.support:support-v4:23.4.0.
Required by:
xcmg:app:unspecified > com.google.android.gms:play-services-appindexing:8.1.0 > com.google.android.gms:play-services-basement:8.1.0
Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "e0a7992f192675817297767391b8206ce7252324"
<a href="fixGradleElements">Fix plugin version and sync projecta><br><a href="openFile:F:\Androidstudio\ListViewDemo\app\build.gradle">Open Filea>
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/3.3/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 2097152KB object heap
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1024m
android.view.InflateException: Binary XML file line #243: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
android.content.res.Resources$NotFoundException: String resource ID #0x2
解决方案:当调用setText()方法时如果传入int型是不会被当成内容而是resourceID来使用!所以把int转成字符串类型
当使用NagivationView时报错:java.lang.reflect.InvocationTargetException
解决方案:(1)将Activity(入口Activity)写成CompatActivity;(2)将Manifest里将该Activity的theme改为@style/Theme.AppCompat的主题。
Error:(1, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Could not create plugin of type 'AppPlugin'.