【问题标题】:React Native - Process 'command 'cmd'' finished with non-zero exit value 1React Native - 进程'命令'cmd''以非零退出值1完成
【发布时间】:2020-05-17 14:19:25
【问题描述】:

执行命令时出现以下错误:gradlew assembleRelease。 我试过更新expo-cli,还是不行。安装并配置jdk、gralde、groovy。还是没有结果。请提出建议。

配置项目:app

安装单模块: 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules@unimodules\core 的 unimodules-core@5.1.2 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules@unimodules\react-native-adapter 的 unimodules-react-native-adapter@5.2.0 expo-av@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-av expo-constants@9.0.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-constants 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-error-recovery 的 expo-error-recovery@1.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-file-system 的 expo-file-system@8.1.0 expo-font@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-font expo-image-loader@1.0.1 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-image-loader 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-keep-awake 的 expo-keep-awake@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-linear-gradient 的 expo-linear-gradient@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-location 的 expo-location@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-permissions 的 expo-permissions@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-sqlite 的 expo-sqlite@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-updates 的 expo-updates@0.1.3 expo-web-browser@8.2.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-web-browser 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-app-loader 的 unimodules-app-loader@1.0.2 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-barcode-scanner-interface 的 unimodules-barcode-scanner-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-camera-interface 的 unimodules-camera-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-constants-interface 的 unimodules-constants-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-face-detector-interface 的 unimodules-face-detector-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-file-system-interface 的 unimodules-file-system-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-font-interface 的 unimodules-font-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-image-loader-interface 的 unimodules-image-loader-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-permissions-interface 的 unimodules-permissions-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-sensors-interface 的 unimodules-sensors-interface@5.1.0 unimodules-task-manager-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface

配置项目:react-native-tensorflow 警告:配置“编译”已过时,已替换为“实施”和“API”。 它将很快被删除。欲了解更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html 警告:指定的 Android SDK 构建工具版本 (26.0.1) 将被忽略,因为它低于 Android Gradle 插件 3.5.3 的最低支持版本 (28.0.3)。 将使用 Android SDK 构建工具 28.0.3。 要禁止显示此警告,请从您的 build.gradle 文件中删除“buildToolsVersion '26.0.1'”,因为每个版本的 Android Gradle 插件现在都有一个默认版本的构建工具。

Kotlin Gradle 插件在不同的子项目中被多次加载,这是不受支持的,并且可能会破坏构建。 这可能发生在使用 Gradle 'plugins { ... }' DSL 应用 Kotlin 插件的子项目中,如果它们指定显式版本,即使版本相同。 请将 Kotlin 插件添加到公共父项目或根项目中,然后删除子项目中的版本。 如果父项目不需要插件,请在插件行添加“应用假”。 见:https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl Kotlin 插件在以下项目中加载:':expo-error-recovery', ':react-native-webview'

任务:app:bundleReleaseExpoUpdatesAssets

C:\Users\Srini\Workspace\React\newApp\MyReactNative>SET /P STOREDPATH= 0

C:\Users\Srini\Workspace\React\newApp\MyReactNative>SET PATH="\"C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java \javapath;C:\Program Files (x86)\iis express\PHP\v5.6;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell \v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C: \Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn \ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\; C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS \Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Micro软 SQL Server\150\DTS\Binn\;C:\Program Files\Java\jdk-14.0.1;C:\Program Files\nodejs\;C:\Windows\System32\WindowsPowerShell\v1.0\;C: \Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;C:\Users\ srini\AppData\Local\Android\Sdk\platform-tools\adb.exe;C:\Program Files\Java\jdk-14.0.1;C:\Program Files\groovy-2.5.9\bin;C:\Gradle \gradle-6.4.1\bin;C:\Users\Srini.windows-build-tools\python27\;C:\Users\Srini\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\ Srini\AppData\Local\Programs\Python\Python38\;JAVA_HOME; $HADOOP_HOME; $HADOOP_BIN; $HADOOP_HOME/bin; $JAVA_HOME/bin;C:\Users\Srini\AppData\Roaming\npm;C:\Users\Srini.dotnet\tools;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\iis express\PHP\v5.6;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\ Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\ Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\ 120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL服务器\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL 服务器\150\DTS\Binn\;C:\Program Files\Java\jdk-14.0.1;C:\Program Files\nodejs\;C:\""

C:\Users\Srini\Workspace\React\newApp\MyReactNative>expo bundle-assets C:\Users\Srini\Workspace\React\newApp\MyReactNative --platform android --dest C:\Users\Srini\ Workspace\React\newApp\MyReactNative\android\app\build\intermediates\merged_assets\release\out [19:39:31] 错误:'C:\Users\Srini\Workspace\React\newApp\MyReactNative\android\app\src\main\assets\app.manifest' 的清单为空或无效。 [19:39:31] 在进行发布构建之前,请确保您至少运行过一次“expo publish”。学到更多。 (ΓÇïhttps://expo.fyi/release-builds-with-expo-updatesΓÇï)

任务:app:bundleReleaseExpoUpdatesAssets 失败

FAILURE:构建失败并出现异常。

  • 出了什么问题: 任务 ':app:bundleReleaseExpoUpdatesAssets' 执行失败。

    进程 'command 'cmd'' 以非零退出值 1 结束

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

  • 通过https://help.gradle.org获得更多帮助

此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。 使用“--warning-mode all”显示各个弃用警告。 见https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings

在 1m 34s 内构建失败 432 个可操作的任务:2 个已执行,430 个最新

【问题讨论】:

  • 我也得到了,只是用另一个应用程序。
  • 添加 react native、expo 版本并添加如何重现此问题?

标签: android react-native tensorflow react-native-android


【解决方案1】:

根据我的经验,finished with non-zero exit value 1 是 Gradle 构建错误的通用占位符。错误的真正原因通常如上所述。

在这种情况下,你有:

Error: The manifest at 'C:\Users\...\app.manifest' was empty or invalid.
[19:39:31] Before making a release build, make sure you have run 'expo publish' at least once. Learn more. (https://expo.fyi/release-builds-with-expo-updates)

Task :app:bundleReleaseExpoUpdatesAssets FAILED

你应该这样做:

  • 检查 app.manifest 确实存在且有效
  • 确保您已按照错误消息中的指示运行 expo publish
  • 查看错误消息中的link 了解更多信息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-26
    • 2019-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-05
    相关资源
    最近更新 更多