Android 当带有某些源的映像在开发环境中正常工作时,React Native signed apk崩溃

Android 当带有某些源的映像在开发环境中正常工作时,React Native signed apk崩溃,android,react-native,Android,React Native,当我在调试模式下运行我的应用程序时 一切正常 但是当我使用 react-native run-android --variant=release 它将正常运行,直到遇到像这样的源图像。应用程序将崩溃,只需重新启动按钮: <Image source={{uri: "https://upload.wikimedia.org/wikipedia/commons/3/30/Googlelogo.png"}} /> 正如您可以看到的屏幕分辨率的差异。第一幅图像非常大,而第二幅图像更像一个图

当我在调试模式下运行我的应用程序时 一切正常

但是当我使用

react-native run-android --variant=release
它将正常运行,直到遇到像这样的源图像。应用程序将崩溃,只需重新启动按钮:

<Image source={{uri: "https://upload.wikimedia.org/wikipedia/commons/3/30/Googlelogo.png"}} />

正如您可以看到的屏幕分辨率的差异。第一幅图像非常大,而第二幅图像更像一个图标,分辨率较低。也许你的设置方式意味着你的应用程序只接受图像的最大字节数。否。大小没关系,这张图片也会崩溃,试试另一张64x64(颜色不多)的图片,如果可以的话,我认为是字节问题。它正在开发中,没有任何图片问题。为什么它必须有64x64??没有颜色?您使用的是什么版本的react和react native?
<Image source={{uri: "https://facebook.github.io/react-native/docs/assets/favicon.png"}} />
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 3036972 byte allocation with 2619648 free bytes and 2MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java)
at android.graphics.Bitmap.nativeCreate(Bitmap.java)
at android.graphics.Bitmap.createBitmap(Bitmap.java:879)
at android.graphics.Bitmap.createBitmap(Bitmap.java:856)
at android.graphics.Bitmap.createBitmap(Bitmap.java:823)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:51)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:26)
at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:255)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeStaticImageFromStream(ArtDecoder.java:147)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeJPEGFromEncodedImage(ArtDecoder.java:127)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decodeJpeg(DefaultImageDecoder.java:173)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder$1.decode(DefaultImageDecoder.java:56)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decode(DefaultImageDecoder.java:119)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:254)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$300(DecodeProducer.java:113)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:152)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:202)
at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:22)
at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51)
at java.lang.Thread.run(Thread.java:761)