Appcenter 构建成功,但找不到 APK 文件 - React Native

问题描述 投票:0回答:2

我们在 AppCenter 中面临 React-Native 问题。一旦我运行构建,一切都很顺利,但最终我们面临以下问题。

AppCenter 中未添加额外的前置或后置脚本。

Execution optimizations have been disabled for 12 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.

**BUILD SUCCESSFUL** in 11m 32s
362 actionable tasks: 351 executed, 11 up-to-date
##[section]Finishing: Gradle Task
##[section]Starting: Android Postprocess
==============================================================================
Task         : Shell script
Description  : Run a shell script using Bash
Version      : 2.212.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
==============================================================================
[command]/bin/bash /Users/runner/runners/2.214.1/scripts/android-postprocess.sh /Users/runner/work/1/s/android/app/build/outputs/apk
Removing all ABI or density dependent APKs…
Found        0 APK file(s)
Found        0 unaligned APK file(s)
~/work/1/s/android/app/build/outputs ~/runners/2.214.1/scripts
~/runners/2.214.1/scripts
##[section]Async Command Start: Add Build Tag
Build '16' has following tags now: normal, android-app-bundle, javascript, android, manual, signed, mapping, distribution
##[section]Async Command End: Add Build Tag
##[section]Finishing: Android Postprocess
##[section]Starting: Sign APK
==============================================================================
Task         : Android signing
Description  : Sign and align Android APK files
Version      : 3.201.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/android-signing
==============================================================================
##****[error]Error: No matching files were found with search pattern: ****/Users/runner/work/1/s/android/app/build/**/*.apk
##[section]Finishing: Sign APK
##[section]Starting: Sign APK
==============================================================================
Task         : Android signing
Description  : Sign and align Android APK files
Version      : 3.201.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/android-signing
==============================================================================
##[section]Finishing: Sign APK
##[section]Starting: Checkout XXXXXXX@development to s
==============================================================================
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: XXXXXXX (ExternalGit)
##[section]Finishing: Checkout XXXXXXX@development to s
##[section]Starting: Finalize Job
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (23181) (java)
Terminate orphan process: pid (22867) (java)
Terminate orphan process: pid (11113) (java)
Terminate orphan process: pid (7987) (java)
##[section]Finishing: Finalize Job
##[section]Finishing: Build

我尝试了所有选项,但无法解决问题。

react-native visual-studio-app-center appcenter
2个回答
0
投票

我得到了自己问题的答案。根据Appcenter文档,您需要将universalApk设置为true。这是在 Appcenter 天气中您计划制作多个 apk 来减小大小的唯一方法。


0
投票

AppCenter 正在寻找 /Users/runner/work/1/s/android/app/build/... 来获取 APK。 /Users/runner/work/1/s 就像 AppCenter 已检查您的源代码的项目文件夹。

找出你的project.buildDir是什么(它可以在build.gradle文件中配置)。您可以通过在本地构建项目并检查 .apk 文件的创建位置来完成此操作。

将project.buildDir设置为android/app/build。现在 AppCenter 应该可以找到它。

© www.soinside.com 2019 - 2024. All rights reserved.