Generate Apk gives erron in react-native - 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.

Related

I want to start Making mods in minecraft and I have a problem when i am trying to run Gradlew setupDecompWorkspace it gives me a error

When I open powershell I typed ./gradlew setupDecompWorkspace it gives me that
* What went wrong:
Task 'setupDecompWorkspace' not found in root project 'forge-1.12.2-14.23.5.2859-mdk'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 8s
PS C:\Users\Ostrov\Desktop\Minecraft Mod Creation\forge-1.12.2-14.23.5.2859-mdk>```
It says BUILD FAILED in 8s because I tried to install it and it installed it for a few minutes but then it says there is an error and build failed
Are you using the mdk from Forge's website?
If you're on IntelliJ, you don't have to run this command. It automatically sets up the Gradle project. You should get a UI that looks like this:
Now, instead of typing the command, you can just click genIntellijRuns under the fg_runs section of the Gradle menu.

How do i build react-native application

i just created a new react-native app using npx create-react-native-app myapp which was successfully created. but when i try to build it using gradlew assembleRelease, i get this error
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Failed to find Platform SDK with path: platforms;android-30
* 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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 43s
it appears like teres a gradle problem. how do i fix it?

React Native Error Execution failed for task ':app:mergeReleaseResources' building APK

I have read and follow this solution to delete drawable files but it is still not working.
This is the link that I follow: Error Execution failed for task ':app:mergeReleaseResources' building APK
Here is the error code after i have followed the above method:
> Task :app:mergeReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> [raw/app] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\src\main\res\raw\app.json [raw/app] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\build\generated\res\react\release\raw\app.json: Error: Duplicate resources
[raw/node_modules_reactnativevectoricons_glyphmaps_ionicons] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\src\main\res\raw\node_modules_reactnativevectoricons_glyphmaps_ionicons.json [raw/node_modules_reactnativevectoricons_glyphmaps_ionicons] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\build\generated\res\react\release\raw\node_modules_reactnativevectoricons_glyphmaps_ionicons.json: Error: Duplicate resources
* 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.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5m 10s
Any help?
After researching on google and find no other similar solution, i then try to delete the duplicate files mention in the error and it works!
These are the 2 files i have removed:
android\app\src\main\res\raw\app.json
android\app\build\generated\res\react\release\raw\app.json
After removing these 2 files, i then run:
cd android
./gradlew assembleRelease
Then it shows me build successful :)
You need to clean the duplicates resources.
use the following commands
rm -rf ./android/app/src/main/res/drawable-*
rm -rf ./android/app/src/main/res/raw

npx react-native run-android does not work. "java.io.IOException: The filename, directory name, or volume label syntax is incorrect"

Just recently ejected expo and I'm trying to run my app on an android device. I followed the instructions (hopefuly right) but I keep getting this error when I try to run my app:
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.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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 3s
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.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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 3s
at makeError (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:174:9)
at C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\#react-native-community\cli\build\index.js:186:9)
i am just using windows 7 32 bit i am also faced the same problem i solved like
you have local.properties file in your android folder or create one
in that file you have give sdk dir path like
give like this
sdk.dir=C:\\Users\\yourusername\\AppData\\Local\\Android\\Sdk
dont give like
sdk.dir=C:\Users\yourusername\AppData\Local\Android\Sdk
windows does not allow

Execution failed for task ':app:preDebugBuild'

I'm working on a route map app with Flutter using google_maps_webservice,location,map_view package after run
Launching lib\main.dart on SAMSUNG SM G530AZ in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDebugBuild'.
Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (15.0.1) and runtime (16.0.1) classpath. You should manually set the same version via DependencyResolution
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 11s
Finished with error: Gradle task assembleDebug failed with exit code 1
Finaly after sevral day i've found, the package map_view have many dependencies conflict between the migration androidX and android.support: so instead of continue using mapview I'm using cirrus_map_view the correction version of map_view and it work!