info JS server already running.
info Installing the app...
Task :#react-native-community_datetimepicker:compileDebugJavaWithJavac
Task :react-native-fbsdk:compileDebugJavaWithJavac
Task :react-native-gesture-handler:compileDebugJavaWithJavac
Task :react-native-maps:compileDebugJavaWithJavac
Task :react-native-reanimated:compileDebugJavaWithJavac
Task :app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.reflect.UndeclaredThrowableException
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 47s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
Have you installed all the Environment Dependencies mentioned in the react-native docs? Use the below link
Environment Setup for react-native
Go to the above link Select Development and Target OS and follow the instructions
react-native: 0.60.6 => 0.60.4, fixed it for me. Thanks.
for more details : Execution failed for task ':app:compileDebugJavaWithJavac'. React Native
Related
PS D:\OCR2>
PS D:\OCR2> cd android
PS D:\OCR2\android> ./gradlew clean
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
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-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: 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
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.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 6s
5 actionable tasks: 5 up-to-date
PS D:\OCR2\android>
I am having issue with my react native app android build having this error message pop up
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> com.android.builder.errors.EvalIssueException: CMake '3.18.1' was not found in SDK, PATH, or by cmake.dir property.
* 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
and then the build fails if anyone knows this issue please could help me solve this , im using metro not expo
Try to add this line below presets in babel.config.js file.
plugins: [
'react-native-reanimated/plugin',
],
Open SDK Manager
Switch to the SDK Tools tab
Install CMake (select the version highlighted in your error)
hello guys i have 2 react-native-cli projects in my pc
the first project was created using react-native init myproject and it is working fine when i run it on my android phone through usb cable
i dont get any errors on react-native run-android i have installed all the necessary things like jdk,sdk, etc so it is working fine.
now the 2nd project which i have cloned from github repo and after that i do npm install and after getting node_modules etc i try to run it react-native run-android the same way but i get errors running this project
here is errors list
**FAILURE: Build failed with an exception.
What went wrong:
Could not open settings generic class cache for settings file 'D:\Soft Projects\pt project\pt_mobile_app\android\settings.gradle' (C:\Users\Ayan Computer.gradle\caches\6.9\scripts\3hjanr5wss637aq9ij7rjm2xr).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 62
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 1s
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**
BUILD FAILED in 1s
at makeError (D:\Soft Projects\pt project\pt_mobile_app\node_modules\execa\index.js:174:9)
at D:\Soft Projects\pt project\pt_mobile_app\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\Soft Projects\pt project\pt_mobile_app\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\Soft Projects\pt project\pt_mobile_app\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
I tried launch my app in React Native with npx react-native run-android on terminal and this error happen
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.3/userguide/command_line_interface.html#sec:command_line_warning
Picked up _JAVA_OPTIONS: -Xmx512M
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\mikae\Desktop\AppDentista\android\app\build.gradle' line: 87
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not read script 'C:\Users\mikae\Desktop\AppDentista\node_modules\expo-updates\scripts\create-manifest-android.gradle' as it does not exist.
* 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 ':app'.
> 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 1m 45s
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
Picked up _JAVA_OPTIONS: -Xmx512M
I wanna start and install my application on Android emulator, but this error always happen when I try. This says something is missing, but I don't know what. I didn't find the same problem as mine elsewhere on the internet
I already got, if you have the same problem. Do you need install all dependencies again (Android Studio, React and Java). After that, create a project with npx react-native init Project, and finish!
I am trying to integrate react-native-device-info to my project and when I install the module and link it an error comes up like this
```
* 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 6s
13 actionable tasks: 1 executed, 12 up-to-date
```
And when I configure the project manually same error comes up.But when I unlink react native device info, the project runs well.
Add this block in your app/build.gradle file below buildTypes{} block and run the app again
configurations.all {
resolutionStrategy {
force 'com.google.android.gms:play-services-base:16.0.1'
}
}