gpt4 book ai didi

java - 使用 Android Studio 虚拟设备执行任务 ':react-native-gesture-handler:compileDebugJavaWithJavac' 失败

转载 作者:行者123 更新时间:2023-12-02 09:40:11 27 4
gpt4 key购买 nike

我无法正确设置我正在做的事情,让我们尽可能多地解释一下:我与一个使用 Andross 包启动 Ignite 项目的人一起工作,我克隆了存储库并尝试使用 this tutorial 运行该应用程序,我正确地完成了所有操作并且能够运行我的虚拟设备,但我必须 chmod 777 我的 node_modules/ 和我的 android/ 对于某些原因,但它不起作用,我读过 here我必须 npm i jetifier 但它没有做太多事情,说实话我不知道我在做什么,我真的需要帮助。

这是我尝试 react-native run-android 时得到的结果:

react-native run-android
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- react-native-vector-icons: https://github.com/oblador/react-native-vector-icons
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-device-info (to unlink run: "react-native unlink react-native-device-info")
- react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
- react-native-i18n (to unlink run: "react-native unlink react-native-i18n")
- react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1007 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...

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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 1 executed, 26 up-to-date
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerStateChangeEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
Note: /home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides 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.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-gesture-handler: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 1s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package androidx.core.util does not exist
import androidx.core.util.Pools;
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool<RNGestureHandlerStateChangeEvent> EVENTS_POOL =
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
/home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
Note: /home/justicemadness/Documents/Work/Ideel/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides 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.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-gesture-handler: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 1s

at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:169:41)
at then.result (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:135:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

我很乐意提供你们需要的任何其他信息来帮助我。

最佳答案

最新版本的react-native需要AndroidX。你必须jetify项目,直到维护者更新他们的包,使用:

npm install --save-dev jetifier && npx jetify

之后就

react-native run-android

关于java - 使用 Android Studio 虚拟设备执行任务 ':react-native-gesture-handler:compileDebugJavaWithJavac' 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57146956/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com