为什么应用程序在 API 19 上工作,但在 API 26 上不工作?目标 API 28

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

为什么应用程序可以在 API 19 上运行,但不能在 API 26 上运行?目标 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

您是否在您的应用中使用了图片?错误是它占用了大量内存,而您的设备或模拟器上没有足够的内存?要解决图像问题,请压缩图像大小然后使用它。它会起作用