Unable to build on Android after upgrading lottie version 3.5.0 to 4.1.3
See original GitHub issueAfter changing from gradle distributionUrl=https://services.gradle.org/distributions/gradle-6.3-bin.zip to distributionUrl=https://services.gradle.org/distributions/gradle-7.1.1-all.zip and upgrade lottie library version in react native from 3.5.0 to 4.1.3 the app was unable to build and prompt the following exception:-
`Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-
Where: Build file ‘/Users/inphosoftmalaysia/nacli-mobile/node_modules/react-native-reanimated/android/build.gradle’ line: 21
-
What went wrong: A problem occurred evaluating project ‘:react-native-reanimated’.
Plugin with id ‘maven’ not found.
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================
2: Task failed with an exception.
- What went wrong: A problem occurred configuring project ‘:react-native-reanimated’.
compileSdkVersion is not specified. Please add it to build.gradle
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================
-
Get more help at https://help.gradle.org
BUILD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDevdebug -PreactNativeDevServerPort=8081`
Steps to Reproduce Basically I just upgraded to latest versions:
- yarn add lottie-react-native from 3.5.0 to 4.1.3
- yarn add lottie-ios from 3.1.8 to 3.2.3
- react-native run-android
Expected behavior: To compile Android successfully.
Actual behavior: After step 3, I got the build exception.
Package versions
"lottie-ios": "3.2.3", "lottie-react-native": "^4.1.3", "react-native": "0.63.2",
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Here is a work-around solution that is working for me.
Add this into the root build.gradle, and it will add a blank ‘compile’ configurations to avoid the crash during configuration evaluation of the Javadocs task.
Seems like it might be a problem with gradle plugin version. Can you try using 6.9 instead of 7.1.1? Also, your React Native version is quite old so it might be an issue.