所以我正在和我的团队一起做这个项目。一开始我有两个问题,你可以在这个页面上找到:
React-native problem with launching the app
我不知道这两个问题是不是已经消失了,或者我只是把另一个问题放在了上面,但它就在这里。如果你有任何线索,请写信给我,我正在努力解决这个问题很久了。起初,当我与其他队友合并我的分支时,一切都很好,但在第二次合并后发生了这种情况:
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
发布于 2020-12-25 01:07:51
你安装android-platform-tools了吗?
如果已经连接,请检查您的设备是否连接了run this:
$ adb设备
它将显示您的设备ID
如果您的设备已连接,但仍显示错误,请尝试执行以下操作:
$ adb -s反向tcp:8081 tcp:8081
然后再运行一次。如果仍然出错,请尝试执行以下操作:
$ npx react-native run-android --deviceId
发布于 2020-12-25 06:11:41
https://stackoverflow.com/questions/65443286
复制相似问题