2

I started to develop an android application, and I'm following tutorials. After I developed the first layout and launched the emulator. I get an "App X has stopped" error. Thanks

07-19 16:35:19.113 8380-8380/? I/zygote: Not late-enabling -Xcheck:jni (already on)
07-19 16:35:19.364 8380-8380/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
07-19 16:35:19.554 8380-8387/? I/zygote: Debugger is no longer active
07-19 16:35:20.591 8380-8380/? I/InstantRun: starting instant run server: is main process
07-19 16:35:30.584 8380-8391/ma.ac.iav.equineupperrespiratoryguide I/zygote: NativeAllocBackground concurrent copying GC freed 2710(1039KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 656KB/2MB, paused 2.481ms total 420.596ms
07-19 16:35:30.857 8380-8391/ma.ac.iav.equineupperrespiratoryguide I/zygote: NativeAllocBackground concurrent copying GC freed 76(32KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 646KB/2MB, paused 13.672ms total 91.301ms
07-19 16:35:31.040 8380-8391/ma.ac.iav.equineupperrespiratoryguide I/zygote: NativeAllocBackground concurrent copying GC freed 57(43KB) AllocSpace objects, 0(0B) LOS objects, 70% free, 635KB/2MB, paused 5.447ms total 41.602ms
07-19 16:35:31.094 8380-8512/ma.ac.iav.equineupperrespiratoryguide D/OpenGLRenderer: HWUI GL Pipeline
07-19 16:35:31.310 8380-8512/ma.ac.iav.equineupperrespiratoryguide I/OpenGLRenderer: Initialized EGL, version 1.4
07-19 16:35:31.310 8380-8512/ma.ac.iav.equineupperrespiratoryguide D/OpenGLRenderer: Swap behavior 1
07-19 16:35:31.314 8380-8512/ma.ac.iav.equineupperrespiratoryguide W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
07-19 16:35:31.314 8380-8512/ma.ac.iav.equineupperrespiratoryguide D/OpenGLRenderer: Swap behavior 0
07-19 16:35:31.370 8380-8512/ma.ac.iav.equineupperrespiratoryguide D/EGL_emulation: eglCreateContext: 0xa0d05480: maj 2 min 0 rcv 2
07-19 16:35:31.479 8380-8512/ma.ac.iav.equineupperrespiratoryguide D/EGL_emulation: eglMakeCurrent: 0xa0d05480: ver 2 0 (tinfo 0xa0d03220)
07-19 16:35:31.660 8380-8380/ma.ac.iav.equineupperrespiratoryguide D/AndroidRuntime: Shutting down VM


--------- beginning of crash
07-19 16:35:31.676 8380-8380/ma.ac.iav.equineupperrespiratoryguide 
E/AndroidRuntime: FATAL EXCEPTION: main
Process: ma.ac.iav.equineupperrespiratoryguide, PID: 8380
java.lang.RuntimeException: Canvas: trying to draw too large(114307200bytes) bitmap.
    at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
    at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
    at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
    at android.view.View.getDrawableRenderNode(View.java:19381)
    at android.view.View.drawBackground(View.java:19317)
    at android.view.View.draw(View.java:19114)
    at android.view.View.updateDisplayListIfDirty(View.java:18073)
    at android.view.View.draw(View.java:18851)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4214)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4000)
    at android.view.View.updateDisplayListIfDirty(View.java:18064)
    at android.view.View.draw(View.java:18851)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4214)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4000)
    at android.view.View.updateDisplayListIfDirty(View.java:18064)
    at android.view.View.draw(View.java:18851)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4214)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4000)
    at android.view.View.updateDisplayListIfDirty(View.java:18064)
    at android.view.View.draw(View.java:18851)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4214)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4000)
    at android.view.View.updateDisplayListIfDirty(View.java:18064)
    at android.view.View.draw(View.java:18851)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4214)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4000)
    at android.view.View.draw(View.java:19126)
    at com.android.internal.policy.DecorView.draw(DecorView.java:785)
    at android.view.View.updateDisplayListIfDirty(View.java:18073)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:643)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:649)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:757)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:2980)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2794)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2347)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
    at android.view.Choreographer.doCallbacks(Choreographer.java:723)
    at android.view.Choreographer.doFrame(Choreographer.java:658)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArg

sCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

the layout design app the xml file

Image of the emulator pop up text

image of the emulator pop up text

logcat crashing text

logcat crashing text 2

logcat crashing text 3

Errahbi Zouhair
  • 99
  • 2
  • 10
  • 1
    Please add the entire error stack trace from the logcat to your post... but not as an image. Add the text – Barns Jul 19 '18 at 16:50
  • Hello there and welcome to Stack Overflow. You've come to the right place seeking help if your app keeps crashing. However, the information you have provided us, the pictures and the supporting text you wrote, don't seem to give a whole lot of information about what's really going on inside of your program. It's good to post pieces of source code or a working example that other users can play with or analyze. You also seem to have not captured the entire logcat output, so we can't see where the stacktrace ends (or begins); this is pretty important stuff. Try adding that! – Zimano Jul 19 '18 at 16:50
  • @Zimano Hey guys .i've added the text of the crash ..the layout design and xml file ..thanks – Errahbi Zouhair Jul 19 '18 at 16:58
  • @ErrahbiZouhair You posted the same image twice, did you mean for it to be two different pictures? It's better if you would just paste the text in your post, and format it as code. `Like this`. – Zimano Jul 19 '18 at 17:04
  • @Zimano Done, thanks – Errahbi Zouhair Jul 19 '18 at 17:15

2 Answers2

2

The image you're uploading is too large. Look into using a library like Glide or Picasso to load the image and it will resize it for you so you stop going out of memory or loading an image that doesn't fit. You could write the code yourself but these libraries have already solved the problem.

Dan Hartman
  • 194
  • 4
1

Solution : Try moving the (hi-res) splash bitmap from drawable to drawable-xxhdpi.

Similar problem : Refer this link

“Canvas: trying to draw too large bitmap”

Amit Nayak
  • 583
  • 1
  • 6
  • 17