Android Studio M1 Mac上的React原生Android构建失败错误

oymdgrw7  于 2022-11-16  发布在  Android
关注(0)|答案(1)|浏览(692)

我从github克隆了一个项目,当我试图运行react-native run-android时,我得到了一个构建失败。我试图找到问题,但没有太多的引用,大多数方法都没有解决问题。错误消息如下:

Task :react-native-nodemediaclient: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.7/userguide/command_line_interface.html#sec:command_line_warnings
462 actionable tasks: 2 executed, 460 up-to-date
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-nodemediaclient:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-nodemediaclient:debugCompileClasspath'.
   > Could not find NodeMediaClient-Android-2.9.8.jar (com.github.NodeMedia:NodeMediaClient-Android:2.9.8).
     Searched in the following locations:
         https://www.jitpack.io/com/github/NodeMedia/NodeMediaClient-Android/2.9.8/NodeMediaClient-Android-2.9.8.jar

* 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 48s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-nodemediaclient:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-nodemediaclient:debugCompileClasspath'.
   > Could not find NodeMediaClient-Android-2.9.8.jar (com.github.NodeMedia:NodeMediaClient-Android:2.9.8).
     Searched in the following locations:
         https://www.jitpack.io/com/github/NodeMedia/NodeMediaClient-Android/2.9.8/NodeMediaClient-Android-2.9.8.jar

我尝试删除node_modules,并重新安装。我也尝试清理gradle,但仍然不工作:(
它在iOS上工作,但在Android上不工作。有人知道问题出在哪里吗?

  • Mac M1芯片
  • 操作系统:蒙特雷12.4
  • Java语言版本:14.0.2
mcdcgff0

mcdcgff01#

如果您正在使用Android模拟器,请尝试从Android Studio(设备管理器)中删除它,然后创建一个新的。

相关问题