简体   繁体   中英

Why does the application work on API 19, but does not work on API 26? Target API 28

Why does the application work on API 19, but does not work on API 26? Target API 28

Logcat:

  2018-10-24 23:09:57.577 10744-10744/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.guahoo.tarotoftheday17, PID: 10744
java.lang.OutOfMemoryError: Failed to allocate a 196247420 byte allocation with 4194304 free bytes and 130MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:620)
    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:455)
    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1155)
    at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:720)
   .....and further

Did you used images in your app? The error is that it is take a lot of memory while you don't have enogh memory on your device or emulator? To solve the image problem compress image size then use it. And it will work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM