Environment:
OS: Windows 10
Node: 8.9.4
Yarn: 1.5.1
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found (NB: I have a recent version though)
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2
react-native init AwesomeProject
Navigate to https://facebook.github.io/react-native/docs/image.html and copy-paste the last line for animated gif support:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.facebook.fresco:animated-gif:1.8.1' // For animated GIF support
}
I haven't inserted in my code any Image with gif source, so the app should start normally.
The app crashes instantly. I don't have the chance to debug it.
For RN v0.55, you need to use 1.3.0 which align with
https://github.com/facebook/react-native/blob/0.55-stable/ReactAndroid/build.gradle#L284
| RN Version | Fresco Version |
| ------------- | ------------- |
| <= 0.55 | 1.3.0 |
| 0.56 | 1.9.0 |
| 0.57 | 1.10.0 |
Working with 1.3.0 and react-native 0.55.4. Thank you really much
i have react native 0.54. if when adding
compile 'com.facebook.fresco:fresco:1.3.0'
compile 'com.facebook.fresco:animated-gif:1.3.0'
the error is 'transformDexArchiveWithDexMergerForDebug' then add in app/build.debug:
defaultConfig {
...
multiDexEnabled true
}
as per https://github.com/facebook/fresco/issues/516.
1.3.0 doesn't work on RN0.56, and try many fresco version
compile 'com.facebook.fresco:fresco:1.3.0'
compile 'com.facebook.fresco:animated-gif:1.3.0'
except 1.8.1 works well
compile 'com.facebook.fresco:animated-gif:1.8.1'
Sa
1.3.0 doesn't work on RN0.56, and try many fresco version
compile 'com.facebook.fresco:fresco:1.3.0' compile 'com.facebook.fresco:animated-gif:1.3.0'except 1.8.1 works well
compile 'com.facebook.fresco:animated-gif:1.8.1'
Same issue
I'm using RN0.56.
compile 'com.facebook.fresco:animated-base-support:1.9.0'
compile 'com.facebook.fresco:animated-gif:1.9.0'
This worked well.
Refer
https://facebook.github.io/react-native/docs/0.56/image.html#gif-and-webp-support-on-android and replace 0.56 with your RN version to find out which fresco version to go with.
What would work with RN0.58.4? Fresco version 1.10.0 isnt working
you can see Fresco version in node_modules/react-native/ReactAndroid/gradle.properties
@dulmandakh yeah, I know. I tried
compile 'com.facebook.fresco:fresco:1.10.0'
compile 'com.facebook.fresco:animated-gif:1.10.0'
with rn0.58.4 but while syncing the project, Android Studio is failing to resolve com.facebook.fresco:animated-base-support:1.10.0
Initially it was working okay when I was using RN0.55.2 with fresco version 1.3.0
So what fresco version would support RN0.58.4?
Maybe you should add animated-base-support too, perhaps fresco changed it's packaging.
You can see third party library versions in the file I mentioned earlier.
if using RN Version .60 try adding below inside app build.gradle file
dependencies {
implementation 'com.facebook.fresco:animated-gif:2.0.0'
}
Most helpful comment
For RN v0.55, you need to use 1.3.0 which align with
https://github.com/facebook/react-native/blob/0.55-stable/ReactAndroid/build.gradle#L284
| RN Version | Fresco Version |
| ------------- | ------------- |
| <= 0.55 | 1.3.0 |
| 0.56 | 1.9.0 |
| 0.57 | 1.10.0 |