lottie-react-native project target this library as 2.5.+ dependency,
as 2.5.5 we could compile fine since it was compiled with java 1.7.
now as 2.5.6:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
how to fix that ? thx
Why was this change necessary? I use desugar=false because of a different issue and that means I can't use the latest lottie version.
I have temporary solved issue by forcing gradle to take 2.5.5 version
configurations.all {
resolutionStrategy {
force "com.airbnb.android:lottie:2.5.5"
}
}
by adding this in project's build.gradle file
I had to add the line from @AnujKosambi to
android/app/build.gradle
In the section
android{
...
configurations.all {
resolutionStrategy {
force 'com.airbnb.android:lottie:2.5.5'
}
}
}
for it to work correctly.
I have same issue, with lottie 2.5.0
error
/////////
Running dex as a separate process.
To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB.
To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
4 errors; aborting
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
tried increasing heap size, no use.
I'll revert the java 8 upgrade
Fixed in https://github.com/airbnb/lottie-android/commit/17b64db1b082b11397b122f43179de7e9ddf791c
Will release 2.6.0 soon.
This is fixed in 2.5.7, but somehow 2.5.7 never made it into the maven repository. So either we'll have to wait for 2.6.0 or 2.5.7 should be properly released.
Most helpful comment
I have temporary solved issue by forcing gradle to take 2.5.5 version
by adding this in project's build.gradle file