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
Related
I have a question about running React-native-cli project. When I ran this command: npx react-native run-android , it returned this result:
info Installing the app...
> Task :app:generatePackageList FAILED
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
1 actionable task: 1 executed
FAILURE: Build failed with an exception.
* Where:
Script 'D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 131
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Script 'D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 131
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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
at makeError (D:\IT\React.js\JAMK\e06Movies\node_modules\execa\index.js:174:9)
at D:\IT\React.js\JAMK\e06Movies\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async runOnAllDevices (D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
I have added --stacktrace in Android Studio by this instruction: "https://stackoverflow.com/questions/21674091/how-to-add-stacktrace-or-debug-option-when-building-android-studio-project" but it didn't work at all.
Can someone suggest to me some solutions for this problem? Thank you very much!!
npx react-native run-android --verbose
I run a react native project on visual studio code and use genymotion.
I got these errors :
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'C:\Users\trann\Desktop\Mobile Apps\Sitter\Sitter\node_modules\react-native-webview\android\build.gradle' line: 26
What went wrong:
A problem occurred evaluating project ':react-native-webview'.
Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt
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-webview'.
compileSdkVersion is not specified.
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 32s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'C:\Users\trann\Desktop\Mobile Apps\Sitter\Sitter\node_modules\react-native-webview\android\build.gradle' line: 26
What went wrong:
A problem occurred evaluating project ':react-native-webview'.
Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt
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-webview'.
compileSdkVersion is not specified.
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 32s
at checkExecSyncError (child_process.js:630:11)
at execFileSync (child_process.js:648:15)
at runOnAllDevices (C:\Users\trann\Desktop\Mobile Apps\Sitter\Sitter\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\trann\Desktop\Mobile Apps\Sitter\Sitter\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\trann\Desktop\Mobile Apps\Sitter\Sitter\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (C:\Users\trann\Desktop\Mobile Apps\Sitter\Sitter\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:164:9)
I got this error I can't able to fix that
enter image description here
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/getting-started.html#android-development-environment. 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:
Task 'installDebug' not found in project ':app'.
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
Any one pls help me...
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.
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