0

I'm new to android development. I use android studio and bluestacks as the emulator. My app on bluestacks = everything is okay. I tried the app on my Sony X8, there's no error as well. But when I try the app on some SAMSUNG devices and my Sony E1, SOME activities return errors and keep needing to be "forced close".

Is it a case of RAM or any specifications of each device?

This is the logcat when one of "error" activities starts on SONY E1:

05-04 08:19:19.877    7625-7625/id.abcd.okay E/test﹕ Exception
05-04 08:19:19.877    7625-7625/id.abcd.okay E/test﹕ OutOfMemoryError
05-04 08:19:21.787    7625-7625/id.abcd.okay I/dalvikvm﹕ hprof: dumping heap strings to "/storage/sdcard0/20150504-011919.hprof".
05-04 08:19:21.867    7625-7625/id.abcd.okay E/dalvikvm﹕ can't open /storage/sdcard0/20150504-011919.hprof: Permission denied
05-04 08:19:21.917    7625-7625/id.abcd.okay E/test﹕ writeHprofDataToFile: caught java.lang.RuntimeException: Failure during heap dump; check log output for details
05-04 08:19:21.937    7625-7625/id.abcd.okay E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{id.abcd.okay/id.abcd.okay.b_n_desimal}: android.view.InflateException: Binary XML file line #90: Error inflating class <unknown>
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2265)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2315)
        at android.app.ActivityThread.access$600(ActivityThread.java:149)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:5235)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:525)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
        at dalvik.system.NativeStart.main(Native Method)
        Caused by: android.view.InflateException: Binary XML file line #90: Error inflating class <unknown>
        at android.view.LayoutInflater.createView(LayoutInflater.java:620)
        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
        at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
        at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
        at id.abcd.okay.b_n_desimal.onCreate(b_n_desimal.java:105)
        at android.app.Activity.performCreate(Activity.java:5133)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2229)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2315)
at android.app.ActivityThread.access$600(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5235)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at id.abcd.okay.b_n_desimal.onCreate(b_n_desimal.java:105)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2229)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2315)
at android.app.ActivityThread.access$600(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5235)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.OutOfMemoryError


at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:503)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:356)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:816)
at android.content.res.Resources.loadDrawable(Resources.java:2117)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:3544)
at android.view.ViewGroup.<init>(ViewGroup.java:459)
at android.widget.FrameLayout.<init>(FrameLayout.java:105)
at android.widget.FrameLayout.<init>(FrameLayout.java:101)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at id.abcd.okay.b_n_desimal.onCreate(b_n_desimal.java:105)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2229)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2315)
at android.app.ActivityThread.access$600(ActivityThread.java:149)
at     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5235)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)

Are there really multiple errors on my code? Which one I've to fix first?

I will post my code -if it is needed- minutes more

here's the code >> http://pastebin.com/M63jWkhG

           

plifendm
  • 3
  • 4

1 Answers1

0

You have Out of memory exception @ d.abcd.okay.b_n_desimal.onCreate(b_n_desimal.java:105)

Allways look at the first error you see like OOM, Nullpointer, Arrayindexoutofbounds

as long as you don't mess it up in code with wrong try and catch clauses you can hunt it down like that

Or you skim through the log and find the first entry where it points a failure directly to one of your source codes you have written and try to figure out what errors could this section produce

Ilja KO
  • 1,272
  • 12
  • 26
  • Yaa, and I've just learned something important today >> http://stackoverflow.com/questions/17900732/how-to-cache-bitmaps-into-native-memory. Thanks to all of you guys for giving me the great clues. – plifendm May 04 '15 at 07:35