首页 > 解决方案 > React Native - 进程'命令'cmd''以非零退出值1完成

问题描述

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

配置项目:app

安装 unimodules:来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules@unimodules\core 的 unimodules-core@5.1.2 来自 C:\Users\Srini\ 的 unimodules-react-native-adapter@5.2.0 Workspace\React\newApp\MyReactNative\node_modules@unimodules\react-native-adapter 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 expo-error-recovery@1.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\ expo-error-recovery expo-file-system@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-file-system 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 expo-keep-awake@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-keep -唤醒 expo-linear-gradient@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-linear-gradient expo-location@8.1.0 来自 C:\Users\Srini\Workspace \React\newApp\MyReactNative\node_modules\expo-location expo-permissions@8.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-permissions expo-sqlite@8.1.0 来自 C: \Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-sqlite expo-updates@0.1.3 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-updates expo-web-来自 C 的 browser@8.2.0:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\expo-web-browser unimodules-app-loader@1.0.2 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-app -loader unimodules-barcode-scanner-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-barcode-scanner-interface unimodules-camera-interface@5.1.0 来自 C: \Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-camera-interface unimodules-constants-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-constants -interface unimodules-face-detector-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-face-detector-interface unimodules-file-system-interface@5.1.0 来自C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-file-system-interface unimodules-font-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules -font-interface unimodules-image-loader-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-image-loader-interface unimodules-permissions-interface@5.1.0 来自C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-permissions-interface unimodules-sensors-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules -sensors-interface unimodules-task-manager-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-font-interface unimodules-image-loader-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules -image-loader-interface unimodules-permissions-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-permissions-interface unimodules-sensors-interface@5.1.0 来自 C: \Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-sensors-interface unimodules-task-manager-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules -任务管理器界面\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-font-interface unimodules-image-loader-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules -image-loader-interface unimodules-permissions-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-permissions-interface unimodules-sensors-interface@5.1.0 来自 C: \Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-sensors-interface unimodules-task-manager-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules -任务管理器界面0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-permissions-interface unimodules-sensors-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules \unimodules-sensors-interface unimodules-task-manager-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-task-manager-interface0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules\unimodules-permissions-interface unimodules-sensors-interface@5.1.0 来自 C:\Users\Srini\Workspace\React\newApp\MyReactNative\node_modules \unimodules-sensors-interface 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.expo\PATH"

\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)\Microsoft 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:

C:\Users\Srini\Workspace\React\newApp\MyReactNative>expo 捆绑资产 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 FAILED

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

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

BUILD FAILED in 1m 34s 432 个可操作的任务:2 个已执行,430 个是最新的

标签: androidreact-nativetensorflowreact-native-android

解决方案


以我的经验,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按照错误消息中的指示运行
  • 检查错误消息中的链接以获取更多信息

推荐阅读