2016-09-29 50 views
1

我使用rn 0.33和之后./android & & gradlew assembleRelease我得到app-debug.apk和app-release.apk。App-release.apk不包含图像

如果我用包装程序在我的设备上安装debug.apk,我的应用程序中显示的所有图像都正确,但是在release.apk中,所有图像都消失了。

任何想法?

+0

你是什么意思的图像都不见了?您能否准确地显示日志,代码和所有内容的问题? – octohedron

回答

0

如果它在调试中起作用,但它不再适用于发布,可能是ProGuard的一个问题。

这些图像是不是gifs?

默认情况下,Android不支持GIF和WebP。

根据您的应用需求,您需要在​​中添加一些可选模块。

dependencies { 
    // If your app supports Android versions before Ice Cream Sandwich (API level 14) 
    compile 'com.facebook.fresco:animated-base-support:0.11.0' 

    // For animated GIF support 
    compile 'com.facebook.fresco:animated-gif:0.11.0' 

    // For WebP support, including animated WebP 
    compile 'com.facebook.fresco:animated-webp:0.11.0' 
    compile 'com.facebook.fresco:webpsupport:0.11.0' 

    // For WebP support, without animations 
    compile 'com.facebook.fresco:webpsupport:0.11.0' 
} 

另外,如果你使用GIF使用ProGuard,你将需要在proguard-rules.pro添加此规则:

-keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl { 
    public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory, com.facebook.imagepipeline.core.ExecutorSupplier); 
} 

GIF and WebP support on Android.