'> Task :expo-location:compileDebugJavaWithJavac FAILED react-native
I'm trying to run my application & I don't understand why this exception is generated
I run a yarn upgrade and I think that what maybe the reason for this error because the app was just fine.
So anyone had faced the same problem ?
Package.json
"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.3",
"@react-native-community/cli": "^7.0.3",
"@react-native-firebase/app": "^14.7.0",
"@react-native-firebase/auth": "^14.7.0",
"@react-native-firebase/database": "^14.7.0",
"@react-native-firebase/firestore": "^14.7.0",
"@react-native-google-signin/google-signin": "^7.2.2",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/stack": "6.1.1",
"axios": "^0.26.1",
"base-64": "^1.0.0",
"expo": "~44.0.2",
"expo-location": "^14.0.2",
"expo-splash-screen": "~0.14.1",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-ble-manager": "^8.0.2",
"react-native-ble-plx": "^2.0.3",
"react-native-fbsdk": "^3.0.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.4.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-notifications": "^4.3.1",
"react-native-paper": "^4.12.0",
"react-native-safe-area-context": "^4.2.4",
"react-native-screens": "^3.13.1",
"react-native-segmented-round-display": "^1.0.0",
"react-native-svg": "^12.3.0",
"react-native-vector-icons": "^9.1.0",
"react-native-web": "0.17.1"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
This is what I get in the console :
What's weird it's that error of using Java 11 instead of 1.8 which was already working, U just run by mistake yarn upgrade.
> Task :expo-file-system:compileDebugKotlin
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (8, 19): 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (419, 27): Type mismatch: inferred type is String? but String was expected
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (463, 29): Type mismatch: inferred type is String? but String was expected
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (552, 43): Parameter 'options' is never used
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (640, 46): Parameter 'options' is never used
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (764, 43): Unchecked cast: Any? to Map<String, Any>?
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (769, 36): Type mismatch: inferred type is String? but String was expected
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (786, 15): Unchecked cast: Any to Map<String, Any>
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (918, 49): Unchecked cast: Any? to Map<String, Any>?
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (1019, 43): Unchecked cast: Any? to Map<String, Any>?
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (1031, 9): 'execute(vararg FileSystemModule.DownloadResumableTaskParams?): AsyncTask<FileSystemModule.DownloadResumableTaskParams?, Void?, Void?>!' is deprecated. Deprecated in Java
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (1092, 47): 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (1092, 47): 'constructor AsyncTask<Params : Any!, Progress : Any!, Result : Any!>()' is deprecated. Deprecated in Java
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (1105, 21): Variable 'count' initializer is redundant
w: D:\Projets\LeCapteurFr\node_modules\expo-file-system\android\src\main\java\expo\modules\filesystem\FileSystemModule.kt: (1276, 35): Type mismatch: inferred type is String? but String was expected
> Task :expo-font:compileDebugKotlin
w: D:\Projets\LeCapteurFr\node_modules\expo-font\android\src\main\java\expo\modules\font\FontLoaderModule.kt: (55, 38): Type mismatch: inferred type is String? but String was expected
> Task :expo-location:compileDebugJavaWithJavac 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.9/userguide/command_line_interface.html#sec:command_line_warnings
344 actionable tasks: 334 executed, 10 up-to-date
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\Projets\LeCapteurFr\node_modules\@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\Projets\LeCapteurFr\node_modules\@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-location:compileDebugJavaWithJavac'.
> Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'.
* 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 24s
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
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: D:\Projets\LeCapteurFr\node_modules\@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\Projets\LeCapteurFr\node_modules\@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-location:compileDebugJavaWithJavac'.
> Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'.
* 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 24s
at makeError (D:\Projets\LeCapteurFr\node_modules\execa\index.js:174:9)
at D:\Projets\LeCapteurFr\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (D:\Projets\LeCapteurFr\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\Projets\LeCapteurFr\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PC\AppData\Roaming\npm-cache\_logs\2022-05-24T16_53_16_769Z-debug.log
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
