【问题标题】:React Native Error Occur, Someone Know About This ErrorReact Native 发生错误,有人知道这个错误
【发布时间】:2023-01-23 18:06:01
【问题描述】:

此构建中使用了已弃用的 Gradle 功能,使其与 Gradle 8.0 不兼容。

您可以使用“--warning-mode all”来显示各个弃用警告并确定它们是否来自您自己的脚本或插件。

https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings 5 个可操作的任务:5 个是最新的

失败:构建失败,出现异常。

  • 在哪里: 构建文件 'D:\React Native Applications\FirstProject\android\app\build.gradle' 行:240

  • 什么地方出了错: 配置项目“:app”时出现问题。

groovy.lang.MissingPropertyException:没有这样的属性:类的 ABI:org.gradle.api.tasks.OutputFile

  • 尝试:

使用 --stacktrace 选项运行以获取堆栈跟踪。 使用 --info 或 --debug 选项运行以获得更多日志输出。 使用 --scan 运行以获得完整的见解。

17 秒内构建失败

错误无法安装应用程序。确保您已经设置了 Android 开发环境:https://reactnative.dev/docs/environment-setup。 错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

失败:构建失败,出现异常。

  • 在哪里: 构建文件 'D:\React Native Applications\FirstProject\android\app\build.gradle' 行:240

  • 什么地方出了错: 配置项目“:app”时出现问题。

groovy.lang.MissingPropertyException:没有这样的属性:类的 ABI:org.gradle.api.tasks.OutputFile

  • 尝试:

使用 --stacktrace 选项运行以获取堆栈跟踪。 使用 --info 或 --debug 选项运行以获得更多日志输出。 使用 --scan 运行以获得完整的见解。

17 秒内构建失败

at makeError (D:\React Native Applications\FirstProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)        
at D:\React Native Applications\FirstProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\React Native Applications\FirstProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\React Native Applications\FirstProject\node_modules\@react-native-community\cli\build\index.js:142:9)

info 使用 --verbose 标志运行 CLI 以获取更多详细信息。

请提供有关此错误的解决方案

【问题讨论】:

    标签: reactjs react-native react-hooks react-native-navigation


    【解决方案1】:

    所以,如果你的项目在 React-Native 应用中出现此类错误,只需打开 android/app/build.gradle Line: 240 ,删除这一行 def abi = output.getFilter(OutputFile.ABI)

    并通过以下代码。 def abi = output.getFilter(com.android.build.OutputFile.ABI)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-23
      • 1970-01-01
      • 1970-01-01
      • 2021-07-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多