Reputation: 1403
Getting this error in my React-Native app when I run on Android using npx react-native run-android --variant=release
or generate a Release Build. I tried whatever solutions I found on Stackoverflow and GitHub like - upgrading gradle build tools
version, modifying babel.config.js
, clean project, --reset-cache
, rm -rf node_modules
and reinstall, Invalidate and Restart, etc. but none of it solved. It is a blocker since I am not able to generate a build to publish.
I have provided the only stacktrace error available.
> Task :app:bundleReleaseJsAndAssets FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 executed
The system cannot find the path specified.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1
Another information I noticed is I am getting the above stacktrace when the build execution executes :app:bundleReleaseJsAndAssets
and reaches react-native-animated
. I tried the solutions suggested from the similar issues reported in react-native-animated
but that too didn't fix.
I am not able to find whether the issue is with the package or the local project setup.
Also I noticed that the package doesn't seem to be configured properly in Android. Screenshot attached below for reference. This package alone doesn't have the right arrow.
Library versions:
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-reanimated": "2.1.0"
Gradle info:
classpath("com.android.tools.build:gradle:4.0.1")
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
Android Studio Version: 4.2.1
Any Suggestions?
Upvotes: 2
Views: 12328
Reputation: 1
If your doing it for the aab file using ./gradlew assembleRelease
or ./gradlew buildRelease
you can check the build.gradle in app level where you might we using like this
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
The release using a keystore and you might be using the jks over there.
release{
storeFile file('your_key.jks')
storePassword '********'
keyAlias 'abc'
keyPassword '*******'
}
Use keystore instead of jks.
release{
storeFile file('your_key.keystore')
storePassword '********'
keyAlias 'abc'
keyPassword '*******'
}
You can change the jks to keystore using the command line in bash
mv my-release-key.jks my-release-key.keystore
for cmd
rename my-release-key.jks my-release-key.keystore
This might help. Happy Coding :)
Upvotes: 0
Reputation: 511
I was getting a similar issue. After struggling with it for a few hours, realised it was due to babel
.
Upgrading babel
to latest version helped me resolve this issue.
Hope this helps someone.
Upvotes: 1
Reputation: 1403
While checking this answer I found that the below line was present in my code
project.ext.react = [
nodeExecutableAndArgs : ["/usr/local/bin/node"]
];
My other RN projects doesn't have this line but worked fine. So removing the line nodeExecutableAndArgs : ["/usr/local/bin/node"]
fixed the issue.
Upvotes: 1