简体   繁体   中英

React-native problem - Execution failed for task ':app:compileDebugJavaWithJavac'

So I'm working with my team on project. At first I had 2 problems which you can find on this page:

React-native problem with launching the app

I don't know if those 2 problems are gone or I just put another one on top of them but here it is. If you have any clue please write me, I'm trying to fix this problem for so long. At first when I merged my branches with other teammates everything was fine, but then this occure after second merge:

PS C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013> npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1114 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...

> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_app:firebase.bom using default value: 26.0.0
:react-native-firebase_app:play.play-services-auth using default value: 18.1.0
:react-native-firebase_app package.json found at C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_app:version set from package.json: 10.1.0 (10,1,0 - 10001000)
:react-native-firebase_app:android.compileSdk using custom value: 29
:react-native-firebase_app:android.targetSdk using custom value: 29
:react-native-firebase_app:android.minSdk using custom value: 16
:react-native-firebase_app:reactNativeAndroidDir C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\react-native\android

> Configure project :react-native-firebase_auth
:react-native-firebase_auth package.json found at C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-firebase\auth\package.json
:react-native-firebase_app package.json found at C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_auth:firebase.bom using default value: 26.0.0
:react-native-firebase_auth package.json found at C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-firebase\auth\package.json
:react-native-firebase_auth:version set from package.json: 10.1.0 (10,1,0 - 10001000)
:react-native-firebase_auth:android.compileSdk using custom value: 29
:react-native-firebase_auth:android.targetSdk using custom value: 29
:react-native-firebase_auth:android.minSdk using custom value: 16
:react-native-firebase_auth:reactNativeAndroidDir C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\react-native\android

> Task :react-native-community_google-signin:compileDebugJavaWithJavac

> Task :react-native-firebase_app:compileDebugJavaWithJavac

> Task :react-native-gesture-handler:compileDebugJavaWithJavac

> Task :react-native-firebase_auth:compileDebugJavaWithJavac

> Task :react-native-reanimated:compileDebugJavaWithJavac

> Task :react-native-screens:compileDebugJavaWithJavac

> Task :app: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.2/userguide/command_line_interface.html#sec:command_line_warnings
133 actionable tasks: 133 executed
Note: C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-community\google-signin\android\src\main\java\co\apptailor\googlesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-firebase\auth\android\src\main\java\io\invertase\firebase\auth\ReactNativeFirebaseAuthModule.java uses or overrides a deprecated API. 
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\NodesManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\NodesManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\android\app\src\main\java\com\mrent\MainApplication.java:5: error: cannot find symbol
import com.facebook.react.PackageList;
                         ^
  symbol:   class PackageList
  location: package com.facebook.react
C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\android\app\src\main\java\com\mrent\MainApplication.java:84: error: class MainApplication is already defined in package com.mrent
  public class MainApplication extends MultiDexApplication implements ReactApplication {
         ^
C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\android\app\src\main\java\com\mrent\MainApplication.java:29: error: cannot find symbol
          List<ReactPackage> packages = new PackageList(this).getPackages();
                                            ^
  symbol: class PackageList
Note: C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\android\app\src\debug\java\com\mrent\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors

FAILURE: Build failed with an exception.

Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output 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 46s

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
Note: C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013\node_modules\@react-native-community\google-signin\android\src\main\java\co\apptailor\googlesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.       
npm ERR! code 1
npm ERR! path C:\Users\Sven\Desktop\FAKS\MRENT projekt\AIR2013
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "react-native "run-android""

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Sven\AppData\Local\npm-cache\_logs\2020-12-24T20_37_47_564Z-debug.log

Have you install android-platform-tools?

If it's already, check if your device is connected with run this:

$ adb devices

It will show your Device ID

If your device connected, but the error still appear, try this:

$ adb -s reverse tcp:8081 tcp:8081

Then run again. If still error, try this:

$ npx react-native run-android --deviceId

I think you made some mistakes while upgrading version or installing new package.

Please check this.

https://github.com/facebook/react-native/issues/25787

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM