简体   繁体   English

React-native 问题 - 任务 ':app:compileDebugJavaWithJavac' 执行失败

[英]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:起初我有 2 个问题,您可以在此页面上找到它们:

React-native problem with launching the app React-native 启动应用程序时出现问题

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?您是否安装了 android-platform-tools?

If it's already, check if your device is connected with run this:如果已经连接,请检查您的设备是否已连接并运行以下命令:

$ adb devices $ 亚行设备

It will show your Device ID它将显示您的设备 ID

If your device connected, but the error still appear, try this:如果您的设备已连接,但错误仍然出现,请尝试以下操作:

$ adb -s reverse tcp:8081 tcp:8081 $ adb -s 反转 tcp:8081 tcp:8081

Then run again.然后再次运行。 If still error, try this:如果仍然出错,试试这个:

$ npx react-native run-android --deviceId $ npx react-native run-android --deviceId

I think you made some mistakes while upgrading version or installing new package.我认为您在升级版本或安装新的 package 时犯了一些错误。

Please check this.请检查这个。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 任务&#39;:app:compileDebugJavaWithJavac&#39;的执行失败反应本机 - Execution failed for task ':app:compileDebugJavaWithJavac' react native React Native-任务&#39;:app:compileDebugJavaWithJavac&#39;的执行失败 - React Native - Execution failed for task ':app:compileDebugJavaWithJavac' 任务 &#39;:expo-constants:compileDebugJavaWithJavac&#39; 执行失败。 (反应本机) - Execution failed for task ':expo-constants:compileDebugJavaWithJavac'. (React-Native) 任务“:app:compileDebugJavaWithJavac”执行失败。 在运行 React Native 项目时 - Execution failed for task ':app:compileDebugJavaWithJavac'. while running React Native Project 任务&#39;:app:compileDebugJavaWithJavac&#39;的执行失败。 适用于Android的React Native应用程序 - Execution failed for task ':app:compileDebugJavaWithJavac'. React Native application for Android 任务 &#39;:app:compileDebugJavaWithJavac&#39; 的 Android 执行失败。 - 反应原生 - Android Execution failed for task ':app:compileDebugJavaWithJavac'. - React Native React-native android 应用程序的任务“:app:processDebugManifest”执行失败 - React-native Execution failed for task ':app:processDebugManifest' for android app 任务&#39;:app:compileDebugJavaWithJavac的执行失败 - Execution failed for task ':app:compileDebugJavaWithJavac 任务执行失败:app:compileDebugJavaWithJavac - Execution failed for task :app:compileDebugJavaWithJavac 任务应用程序的执行失败:compileDebugJavaWithJavac - Execution failed for task app:compileDebugJavaWithJavac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM