Android: Unable to start Activity, Resource is not a drawable
My error:
01-06 03:25:28.999: ERROR/AndroidRuntime(2255): FATAL EXCEPTION: main 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ximxim.fifteen_puzzle/com.ximxim.fifteen_puzzle.MenuActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.os.Handler.dispatchMessage(Handler.java:99) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.os.Looper.loop(Looper.java:123) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at java.lang.reflect.Method.invokeNative(Native Method) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at java.lang.reflect.Method.invoke(Method.java:521) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at dalvik.system.NativeStart.main(Native Method) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.LayoutInflater.inflate(LayoutInflater.java:385) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.Activity.setContentView(Activity.java:1647) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at com.ximxim.fifteen_puzzle.MenuActivity.onCreate(MenuActivity.java:60) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): ... 11 more 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): Caused by: java.lang.reflect.InvocationTargetException 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.widget.LinearLayout.(LinearLayout.java:115) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at java.lang.reflect.Constructor.constructNative(Native Method) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.LayoutInflater.createView(LayoutInflater.java:500) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): ... 21 more 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020053 a=-1 r=0x7f020053} 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.content.res.Resources.loadDrawable(Resources.java:1681) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.View.(View.java:1885) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.View.(View.java:1834) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): at android.view.ViewGroup.(ViewGroup.java:285) 01-06 03:25:28.999: ERROR/AndroidRuntime(2255): ... 25 more
??? What does it means and how to fix it:
01-06 03:25:28.999: ERROR/AndroidRuntime(2255): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Dra开发者_如何学编程wable (color or path): TypedValue{t=0x1/d=0x7f020053 a=-1 r=0x7f020053}
Your android R.java
file got messed up or was not regenerated. In Eclipse on the top bar just click Project -> Clean... and select your project.
If it still does not work try to manually delete the R.java
file located in gen/mypckg.com.R.java
.
精彩评论