FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
08/26/14 01:45 AM (10 years ago)

errors on live app

hi guys im having problem with my live android app, im sending the error report back from an android device, its an out of memory, connected to row image (i think) can someone point me to the problem, so i can fix it, the error report is below. java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:521) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:374) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785) at android.content.res.Resources.loadDrawable(Resources.java:2005) at android.content.res.Resources.getDrawable(Resources.java:673) at com.buildingregs.BT_fileManager.getDrawableByName(BT_fileManager.java:263) at com.buildingregs.WB_rowImageMenu$ChildItemAdapter.getView(WB_rowImageMenu.java:681) at android.widget.AbsListView.obtainView(AbsListView.java:2186) at android.widget.ListView.measureHeightOfChildren(ListView.java:1250) at android.widget.ListView.onMeasure(ListView.java:1162) at android.view.View.measure(View.java:15697) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4920) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1411) at android.widget.LinearLayout.measureVertical(LinearLayout.java:698) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:15697) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:681) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:15697) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4920) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1411) at android.widget.LinearLayout.measureVertical(LinearLayout.java:698) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:15697) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4920) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:15697) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4920) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:15697) at android.widget.LinearLayout.measureVertical(LinearLayout.java:850) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:15697) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4920) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2297) at android.view.View.measure(View.java:15697) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2165) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1249) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1443) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4872) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776) at android.view.Choreographer.doCallbacks(Choreographer.java:579) at android.view.Choreographer.doFrame(Choreographer.java:548) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762) at android.os.Handler.handleCallback(Handler.java:800) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5371) 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:833) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/26/14 09:17 AM (10 years ago)
I see this sometimes happening when people only have images in res > drawable, and a device that would require an image from, for example, res > drawable-hdpi because of the screen size, tries to use that app. I "believe" that in this case, Android takes the image from res > drawable and resizes it or does some other magic, and that sometimes cause problems. I've been able to avoid this issue by taking all my res > drawable images and making sure to copy them into the other res > drawable-* folders. Even without additional tweaking of the images, this tends to satisfy Android. Mark
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
08/26/14 11:00 AM (10 years ago)
Thanks dude, will have look at that Sean
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
like
08/26/14 11:03 AM (10 years ago)
Yes - I confess I always copy my images into all the drawable folders for Android too.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
08/26/14 09:28 PM (10 years ago)
The error happens on newer devices when android tries to upscale the images. In our case it is unnecessary, because most image settings are set to fit the screen anyway.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
08/27/14 01:27 AM (10 years ago)
thanks guys, ive gone through the images, (360) some of them where slightly wrong size, so just waiting for apk to be published to see if its worked, hopefully it has as putting all the images in other drawable folder will make the app huge, its 13mb now, so any extra folders and its +13mb for each, thanks for your help guys, little problem im having with pdf files on the android app, keeps crashing when you close the pdf, fine on ios, just android, error report is below, if anybody can help. java.lang.RuntimeException: Unable to start activity ComponentInfoxxxxxxxxxxxxxxxxxxxxxxxx.BT_activity_host}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395) at android.app.ActivityThread.access$600(ActivityThread.java:162) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5371) 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:833) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.uktheatres.BT_screen_pdfDoc.onCreateView(BT_screen_pdfDoc.java:77) at android.app.Fragment.performCreateView(Fragment.java:1699) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:885) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1057) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1039) at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1840) at android.app.Activity.performCreate(Activity.java:5204) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1084) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307) ... 11 more
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
08/27/14 01:29 AM (10 years ago)
this is the heading of the above error report java.lang.NullPointerException in com.xxxxxxxxxxxx.BT_screen_pdfDoc.onCreateView
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.