Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Here is my log output. I need your help determining where to begin to solve the issue:
If I execute the app in a device with version 4.4.2, no exception is thrown, but executing the app on a device with lower version, the app crashes..
12-05 11:34:50.716: E/AndroidRuntime(327): FATAL EXCEPTION: main
12-05 11:34:50.716: E/AndroidRuntime(327): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.solinpromex.casajuventudtrescantos/com.solinpromex.casajuventudtrescantos.MainActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.os.Looper.loop(Looper.java:123)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.ActivityThread.main(ActivityThread.java:3683)
12-05 11:34:50.716: E/AndroidRuntime(327): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 11:34:50.716: E/AndroidRuntime(327): at java.lang.reflect.Method.invoke(Method.java:507)
12-05 11:34:50.716: E/AndroidRuntime(327): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-05 11:34:50.716: E/AndroidRuntime(327): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-05 11:34:50.716: E/AndroidRuntime(327): at dalvik.system.NativeStart.main(Native Method)
12-05 11:34:50.716: E/AndroidRuntime(327): Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
12-05 11:34:50.716: E/AndroidRuntime(327): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
12-05 11:34:50.716: E/AndroidRuntime(327): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.Activity.setContentView(Activity.java:1657)
12-05 11:34:50.716: E/AndroidRuntime(327): at com.solinpromex.casajuventudtrescantos.MainActivity.onCreate(MainActivity.java:28)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
12-05 11:34:50.716: E/AndroidRuntime(327): ... 11 more
12-05 11:34:50.716: E/AndroidRuntime(327): Caused by: java.lang.reflect.InvocationTargetException
12-05 11:34:50.716: E/AndroidRuntime(327): at java.lang.reflect.Constructor.constructNative(Native Method)
12-05 11:34:50.716: E/AndroidRuntime(327): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
12-05 11:34:50.716: E/AndroidRuntime(327): ... 22 more
12-05 11:34:50.716: E/AndroidRuntime(327): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.content.res.Resources.loadDrawable(Resources.java:1709)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.widget.ImageView.<init>(ImageView.java:118)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.widget.ImageView.<init>(ImageView.java:108)
12-05 11:34:50.716: E/AndroidRuntime(327): ... 25 more
12-05 11:34:50.726: W/ActivityManager(60): Force finishing
The reason is clear:
12-05 11:34:50.716: E/AndroidRuntime(327): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
Solution: try to use the drawable with smaller resolution.
You have run out of memory which caused a bunch of issues (cannot inflate the activity xml which causes the activity to not start since you get an exception in the onCreate method that is not handled)
12-05 11:34:50.716: E/AndroidRuntime(327): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.content.res.Resources.loadDrawable(Resources.java:1709)
12-05 11:34:50.716: E/AndroidRuntime(327): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
to fix it try loading a smaller size bitmap for in your imageview for lesser devices (pre 4.4.2)
Related
My reports provide me this error but I can't understand how is it possible?
java.lang.RuntimeException: Unable to start activity ComponentInfo{net.aviascanner.aviascanner/net.aviascanner.aviascanner.ui.activities.GetCitiesActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
at android.app.ActivityThread.access$2600(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
... 12 more
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.EditText.<init>(EditText.java:51)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 25 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
at android.content.res.Resources.loadDrawable(Resources.java:1725)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1901)
at android.widget.TextView.<init>(TextView.java:440)
at android.widget.EditText.<init>(EditText.java:55)
... 29 more
Caused by: java.lang.NullPointerException
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
at android.content.res.Resources.loadDrawable(Resources.java:1722)
... 33 more
android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
at android.app.ActivityThread.access$2600(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.EditText.<init>(EditText.java:51)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 25 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
at android.content.res.Resources.loadDrawable(Resources.java:1725)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1901)
at android.widget.TextView.<init>(TextView.java:440)
at android.widget.EditText.<init>(EditText.java:55)
... 29 more
Caused by: java.lang.NullPointerException
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
at android.content.res.Resources.loadDrawable(Resources.java:1722)
... 33 more
java.lang.reflect.InvocationTargetException
at android.widget.EditText.<init>(EditText.java:51)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
at android.app.ActivityThread.access$2600(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
at android.content.res.Resources.loadDrawable(Resources.java:1725)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1901)
at android.widget.TextView.<init>(TextView.java:440)
at android.widget.EditText.<init>(EditText.java:55)
... 29 more
Caused by: java.lang.NullPointerException
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
at android.content.res.Resources.loadDrawable(Resources.java:1722)
... 33 more
android.content.res.Resources$NotFoundException: File res/drawable/selector_edittext.xml from drawable resource ID #0x7f0200c4
at android.content.res.Resources.loadDrawable(Resources.java:1725)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1901)
at android.widget.TextView.<init>(TextView.java:440)
at android.widget.EditText.<init>(EditText.java:55)
at android.widget.EditText.<init>(EditText.java:51)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
at android.app.ActivityThread.access$2600(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
at android.content.res.Resources.loadDrawable(Resources.java:1722)
... 33 more
java.lang.NullPointerException
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
at android.content.res.Resources.loadDrawable(Resources.java:1722)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1901)
at android.widget.TextView.<init>(TextView.java:440)
at android.widget.EditText.<init>(EditText.java:55)
at android.widget.EditText.<init>(EditText.java:51)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:262)
at net.aviascanner.aviascanner.ui.activities.GetCitiesActivity.onCreate(GetCitiesActivity.java:115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)
at android.app.ActivityThread.access$2600(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
I have found this error in my application also. In my application I solved my problem by making the copies of the drawables in all the folders of the drawables i.e. drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi. This works correctly in my application. Hope this will solve your problem if u have not kept the drawables into all the provided drawable folders.
For some reason, I'm getting this error when using HoloEverywhere. My application crashes on creation and my xml layouts are not displaying for below 3.0. Here is my xml error.
Failed to configure parser for C:\Users\Akhil\HoloEverywhere\hololib\res\color\secondary_text_holo_light.xml
Failed to configure parser for C:\Users\Akhil\HoloEverywhere\hololib\res\drawable\background_cache_hint_selector_holo_light.xml
Failed to configure parser for C:\Users\Akhil\HoloEverywhere\hololib\res\color\primary_text_holo_light.xml
Exception details are logged in Window > Show View > Error Log
And here is my logcat. which references an error on line 57 of my activity's onCreate. Line 57 inflates the xml file. This is only happening with HoloEverywhere. Please Help!
12-09 03:01:20.893: E/AndroidRuntime(327): FATAL EXCEPTION: main
12-09 03:01:20.893: E/AndroidRuntime(327): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sample/com.example.sample.CourseListActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class fragment
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.os.Handler.dispatchMessage(Handler.java:99)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.os.Looper.loop(Looper.java:123)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-09 03:01:20.893: E/AndroidRuntime(327): at java.lang.reflect.Method.invokeNative(Native Method)
12-09 03:01:20.893: E/AndroidRuntime(327): at java.lang.reflect.Method.invoke(Method.java:521)
12-09 03:01:20.893: E/AndroidRuntime(327): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-09 03:01:20.893: E/AndroidRuntime(327): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-09 03:01:20.893: E/AndroidRuntime(327): at dalvik.system.NativeStart.main(Native Method)
12-09 03:01:20.893: E/AndroidRuntime(327): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class fragment
12-09 03:01:20.893: E/AndroidRuntime(327): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
12-09 03:01:20.893: E/AndroidRuntime(327): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:278)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-09 03:01:20.893: E/AndroidRuntime(327): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:263)
12-09 03:01:20.893: E/AndroidRuntime(327): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:258)
12-09 03:01:20.893: E/AndroidRuntime(327): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:253)
12-09 03:01:20.893: E/AndroidRuntime(327): at org.holoeverywhere.app.Activity.setContentView(Activity.java:242)
12-09 03:01:20.893: E/AndroidRuntime(327): at com.example.sample.CourseListActivity.onCreate(CourseListActivity.java:57)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-09 03:01:20.893: E/AndroidRuntime(327): ... 11 more
12-09 03:01:20.893: E/AndroidRuntime(327): Caused by: java.lang.ClassNotFoundException: Could not find class: fragment
12-09 03:01:20.893: E/AndroidRuntime(327): at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:318)
12-09 03:01:20.893: E/AndroidRuntime(327): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
12-09 03:01:20.893: E/AndroidRuntime(327): ... 21 more
error log says
Could not find class: fragment
Fragments require API Level 11 or greater :)
If you want to use Fragments on API < 11 you need to use Support Library package for this.
Looks like this was fixed in HoloEverywhere 1.4.1: https://github.com/ChristopheVersieux/HoloEverywhere/issues/
Did updating to 1.4.1 fix the problem for you?
Try to add your fragment programmatically.
That is, your xml should have only the layout 'content' and, onCreate:
if (savedInstanceState == null) {
// Add the fragment on initial activity setup
MyFragment myFragment = new MyFragment();
getSupportFragmentManager().beginTransaction().
add(R.id.content, myFragment).commit();
}
I have two inner fragments in a activity.
Activity is called: MainFragmentActivity (extends FragmentACtivity)
Inside is this:
public static class FeaturedFrag extends ListFragment {
public static class TopFrag extends ListFragment {
How would I identify here?
<fragment
android:id="#+id/featured_frag"
android:layout_width="400dp"
android:layout_height="match_parent"
class="com.---.---.MainFragmentActvity$FeaturedFrag" />
<fragment
android:id="#+id/top_items_frag"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.---.---.MainFragmentActvity$TopItemFrag" />
Changed the XML to the recommendation, LogCat below.
12-05 00:27:35.639: E/AndroidRuntime(1243): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.---.---.MainFragmentActvit$MasterFrag: make sure class name exists, is public, and has an empty constructor that is public
I do have a class with that name, an empty constructor and it is public.
Full LogCat:
12-05 00:37:38.090: E/AndroidRuntime(1384): FATAL EXCEPTION: main
12-05 00:37:38.090: E/AndroidRuntime(1384): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.---.---/com.---.---.master.MainFragmentActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.os.Looper.loop(Looper.java:137)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-05 00:37:38.090: E/AndroidRuntime(1384): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 00:37:38.090: E/AndroidRuntime(1384): at java.lang.reflect.Method.invoke(Method.java:511)
12-05 00:37:38.090: E/AndroidRuntime(1384): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-05 00:37:38.090: E/AndroidRuntime(1384): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-05 00:37:38.090: E/AndroidRuntime(1384): at dalvik.system.NativeStart.main(Native Method)
12-05 00:37:38.090: E/AndroidRuntime(1384): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-05 00:37:38.090: E/AndroidRuntime(1384): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.Activity.setContentView(Activity.java:1867)
12-05 00:37:38.090: E/AndroidRuntime(1384): at com.---.---.master.MainFragmentActivity.onCreate(MainFragmentActivity.java:85)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.Activity.performCreate(Activity.java:5008)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-05 00:37:38.090: E/AndroidRuntime(1384): ... 11 more
12-05 00:37:38.090: E/AndroidRuntime(1384): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.---.---.MainFragmentActivity$MasterFrag: make sure class name exists, is public, and has an empty constructor that is public
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.support.v4.app.Fragment.instantiate(Fragment.java:395)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.support.v4.app.Fragment.instantiate(Fragment.java:363)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:264)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
12-05 00:37:38.090: E/AndroidRuntime(1384): ... 21 more
12-05 00:37:38.090: E/AndroidRuntime(1384): Caused by: java.lang.ClassNotFoundException: com.kickinglettce.rate_this.MainFragmentActivity$MasterFrag
12-05 00:37:38.090: E/AndroidRuntime(1384): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-05 00:37:38.090: E/AndroidRuntime(1384): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-05 00:37:38.090: E/AndroidRuntime(1384): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-05 00:37:38.090: E/AndroidRuntime(1384): at android.support.v4.app.Fragment.instantiate(Fragment.java:385)
12-05 00:37:38.090: E/AndroidRuntime(1384): ... 24 more
Sample code from one of the inner fragments:
public static class MasterFrag extends ListFragment {
// fields
public MasterFrag() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.mastercat, container, false);
}
Proofread all your code. Make sure all class names are the same, are in the same packages, etc. Otherwise Android does not know where anything is.
As for your your original question, the format is class = "package.Activity$Fragment"
I have an Android application in Eclipse Indigo with ADT version 15. Upgrading ADT to the version 21 the program crashes and is impossible to execute over both the emulator and the mobile device.
LogCat shows this error message:
12-05 10:07:35.960: E/AndroidRuntime(31462): FATAL EXCEPTION: main
12-05 10:07:35.960: E/AndroidRuntime(31462): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{test.hello/test.StartActivityZZ}: java.lang.ClassNotFoundException: test.start.StartActivityZZ
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2024)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.access$600(ActivityThread.java:140)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.os.Looper.loop(Looper.java:137)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.main(ActivityThread.java:4898)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.reflect.Method.invoke(Method.java:511)
12-05 10:07:35.960: E/AndroidRuntime(31462): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
12-05 10:07:35.960: E/AndroidRuntime(31462): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
12-05 10:07:35.960: E/AndroidRuntime(31462): at dalvik.system.NativeStart.main(Native Method)
12-05 10:07:35.960: E/AndroidRuntime(31462): Caused by: java.lang.ClassNotFoundException: test.start.StartActivityZZ
12-05 10:07:35.960: E/AndroidRuntime(31462): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-05 10:07:35.960: E/AndroidRuntime(31462): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.Instrumentation.newActivity(Instrumentation.java:1057)
12-05 10:07:35.960: E/AndroidRuntime(31462): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
12-05 10:07:35.960: E/AndroidRuntime(31462): ... 11 more
The Android project uses maven but creating a new one without maven the problem persists and shows the same message.
Any suggestions to fix this problem?
Thanks
At some point (probably after ver 15), the libraries you use must be placed in the "libs" folder. Try placing a copy of your libraries there and retry
01-26 20:45:50.841: E/AndroidRuntime(327): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.demo.app/com.demo.app.Sencha_demoActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.os.Looper.loop(Looper.java:123)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.ActivityThread.main(ActivityThread.java:4363)
01-26 20:45:50.841: E/AndroidRuntime(327): at java.lang.reflect.Method.invokeNative(Native Method)
01-26 20:45:50.841: E/AndroidRuntime(327): at java.lang.reflect.Method.invoke(Method.java:521)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-26 20:45:50.841: E/AndroidRuntime(327): at dalvik.system.NativeStart.main(Native Method)
01-26 20:45:50.841: E/AndroidRuntime(327): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
01-26 20:45:50.841: E/AndroidRuntime(327): at android.content.res.Resources.getValue(Resources.java:891)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1865)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.content.res.Resources.getXml(Resources.java:779)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.phonegap.api.PluginManager.loadPlugins(PluginManager.java:82)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.phonegap.api.PluginManager.<init>(PluginManager.java:62)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.phonegap.DroidGap$1.run(DroidGap.java:414)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.Activity.runOnUiThread(Activity.java:3649)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.phonegap.DroidGap.loadUrlIntoView(DroidGap.java:390)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.phonegap.DroidGap.loadUrl(DroidGap.java:356)
01-26 20:45:50.841: E/AndroidRuntime(327): at com.demo.app.Sencha_demoActivity.onCreate(Sencha_demoActivity.java:11)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-26 20:45:50.841: E/AndroidRuntime(327): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
01-26 20:45:50.841: E/AndroidRuntime(327): ... 11 more
I am a absolute beginner to phonegap and sencha touch. After reading many forums I got this plugin for eclipse : http://www.mobiledevelopersolutions.com/home/start/startdetails
But, when I am trying to run the project with google api 2.1 with minsdk version 7, I am getting the error mentioned above. Any ideas how to recitfy it?
I received a report of what is likely the same issue today and tracked it down. See AppLaud Issue #63.
The Sencha file structure changes in 2.0.0-pr4 cause the AppLaud wizard to fail to complete project creation. plugins.xml is missing and AndroidManifest.xml is not set up.
The workaround is to copy sencha-touch-all-debug-w-comments.js to sencha-touch-debug-w-comments.js and then the wizard will succeed with project completion.
This bug will be fixed in the next AppLaud update due out after the PhoneGap 1.4.0 release.
Also, note that the bundled Sencha PhoneGap example in AppLaud does not yet support the Sencha 2 APIs. See AppLaud Issue #64.
Looks like you are missing the res/xml/plugins.xml file from your project.