Not able to generate Android signed apk - react-native

I am trying this from last 4 days and yet did not found any solution. I am using react-native 0.61.5. while running ./gradlew assembleRelease I am getting:-
FAILURE: Build failed with an exception.
* Where: Script '/Users/blickx/Desktop/dumont-reactnative/Dumont/node_modules/react-native/react.gradle'
line: 291
What went wrong: Execution failed for task ':app:packageRelease'. react_cp2c21m954k2ml4rj79pw17zw$_run_closure4$_closure6$_closure10$_closure18
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.
Please help.

Have you tried to create a new project from scratch and just copy all your files into new project. But first you can try if you are able to create apk in a new created project.

Related

Execution failed for task ':unsw-gsbme_react-native-keep-awake:compileDebugKotlin'

I'm working on a react native bare project that I run and return this error, has anyone seen something similar and a possible solution?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':unsw-gsbme_react-native-keep-awake:compileDebugKotlin'.
> Compilation error. See log for more details
* 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 2m 22s
Do you have any ideas? Did someone met this problem also?
I have tried to run the app, remove this lib with npm but to no avail

react native new project cant run android from vs code terminal

i created a new project and run
npx react-native run-android
command in visual studio code terminal. but i got an error
What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
* 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 21s
but i can build the app with the same command in using iterm
what is difference? cause idk what changed and. i didnt changed anything

Generate Apk gives erron in react-native

I try to generate an apk however it gives me an error on Command Prompt:
What went wrong: Execution failed for task ':app:signReleaseBundle'.
1 exception was raised by workers: java.lang.RuntimeException: java.lang.RuntimeException: jarsigner.exefailed with exit code 1 :
jarsigner: key associated with my-key-alias not a private key
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
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 6.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
Anyone can help me about this error ?
If you previously were building a bundle release with different keystore, please do clean before.
Launching ./gradlew clean shall help.

react-native run-android doesn't build

I'm totally new in react-native and have an Android emulator running but it doesn't build react-native & shows this error...
what should i do?
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not download appcompat-v7.aar (com.android.support:appcompat-v7:28.0.0)
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/28.0.0/appcompat-v7-28.0.0.aar'.
Connection reset
Could not download support-fragment.aar (com.android.support:support-fragment:28.0.0)
Could not get resource
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 8m 56s
1 actionable task: 1 executed
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
First of all you should update your node.js
Then run the installation's cammands and for Iranian it's better to use shecan.ir before running build run-android command instead of unworking vpn.
I did these steps and the problem solved.

Execution failed for task ':app:processReleaseResources'.

i am running sample application. When i generate apk for android getting error like this......
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Failed to process resources, see aapt output above for details.
* 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 59s
39 actionable tasks: 36 executed, 3 up-to-date
Please give me any suggestion for this. Thank you.
In my case helps:
react-native link
react-native run-android --variant=release
You need to delete both ios,android and node module folder. Run the following commands
1) npm install //to get the node module folder
2) react-native upgrade //to get android and ios folder
3) react-native link // for linking the libraries
3) react-native run-ios/android