簡體   English   中英

React-native 問題 - 任務 ':app:compileDebugJavaWithJavac' 執行失敗

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

所以我正在和我的團隊一起做項目。 起初我有 2 個問題,您可以在此頁面上找到它們:

React-native 啟動應用程序時出現問題

我不知道這兩個問題是否已經消失,或者我只是在它們上面放了另一個問題,但它就在這里。 如果您有任何線索,請寫信給我,我一直在努力解決這個問題。 起初,當我將我的分支與其他隊友合並時,一切都很好,但第二次合並后發生了這種情況:

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

您是否安裝了 android-platform-tools?

如果已經連接,請檢查您的設備是否已連接並運行以下命令:

$ 亞行設備

它將顯示您的設備 ID

如果您的設備已連接,但錯誤仍然出現,請嘗試以下操作:

$ adb -s 反轉 tcp:8081 tcp:8081

然后再次運行。 如果仍然出錯,試試這個:

$ npx react-native run-android --deviceId

我認為您在升級版本或安裝新的 package 時犯了一些錯誤。

請檢查這個。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM