【问题标题】:Running react native bare project results in error A problem occurred configuring project ':react-native-reanimated'运行反应原生裸项目导致错误配置项目':react-native-reanimated'时出现问题
【发布时间】:2020-07-31 19:26:45
【问题描述】:

我已经通过 expo kit 安装了 react native,现在当我运行 yarn run android 时,我收到了这个错误。我没有更改模板上的任何内容。我不知道发生了什么。?如果有进一步的关于随时问。我还检查了 react native reanimated 的 build.gradle,但不幸的是,没有成功。

FAILURE: Build failed with an exception. 

* Where:
Build file 'C:\Users\David\Desktop\TheGuruApp\node_modules\react-native-reanimated\android\build.gradle' line: 89

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> java.io.IOException: The filename, directory name, or volume label syntax is incorrect

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

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.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\David\Desktop\TheGuruApp\node_modules\react-native-reanimated\android\build.gradle' line: 89

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> java.io.IOException: The filename, directory name, or volume label syntax is incorrect

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

【问题讨论】:

  • 不只是这个库,我已经删除了,现在错误出现在 react-native 屏幕中
  • 面临同样的问题,任何解决方案。

标签: javascript java android react-native


【解决方案1】:

就我而言,在 Windows 上,local.properties 文件上的 Android SDK 路径错误。需要双反斜杠

【讨论】:

    【解决方案2】:

    您已安装 Android API 级别 29 并重新打开项目...然后它会自行修复。

    只需从 android studio 到 sdk manager 并安装 android 10.0(Q) level 29 ,显示包详细信息 google apis intelx86 Atom 系统映像

    然后重新启动 android studio 并打开它可以工作的项目... image

    【讨论】:

      【解决方案3】:

      下面提到的build.gradle (node_modules\react-native-reanimated\android\build.gradle) 里面的代码有问题:

      android.libraryVariants.all { variant ->
              def name = variant.name.capitalize()
              task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) {
                  from variant.javaCompileProvider.get().destinationDir
              }
      }
      

      如果将其替换为下面提到的代码,则上述问题已解决。

      android.libraryVariants.all { variant ->
              def name = variant.name.capitalize()
              task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
                  from variant.javaCompile.destinationDir
              }
      }
      

      【讨论】:

        【解决方案4】:

        您需要为 react native 设置开发环境。使用以下链接

        https://reactnative.dev/docs/environment-setup

        还要检查它应该高于或 11.0 的 jdk 版本

        【讨论】:

          猜你喜欢
          • 2020-12-19
          • 1970-01-01
          • 2022-08-14
          • 2022-01-14
          • 1970-01-01
          • 2022-08-10
          • 1970-01-01
          • 2021-01-09
          • 1970-01-01
          相关资源
          最近更新 更多