1

我正在使用 Unity (asmadsen/react-native-unity-view) 开发一个 React-Native 项目。该代码在 Android 和 iOS 上都可以正常运行,并且还分别为这两个平台生成了构建。但是现在我正在尝试通过 Appcenter for Android 进行构建,并执行所有必要的设置过程,但它一直都在失败。但是当我为演示 React-Native 项目做同样的事情时,构建在 Appcenter 上是成功的。

在 Appcenter 上找到的错误日志是:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/runner/work/1/s/android/UnityExport/unityLibrary/build.gradle' line: 66

* What went wrong:
Execution failed for task ':UnityExport:BuildIl2CppTask'.
> Location specified by ndk.dir (/Applications/Unity/Hub/Editor/2020.3.16f1/PlaybackEngines/AndroidPlayer/NDK) did not contain a valid NDK and couldn't be used

* 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 3m 56s

任何人都可以有任何想法并帮助我。提前致谢。

4

1 回答 1

0

您的计算机上似乎没有有效的 NDK,对于 unity 2018,您必须安装android-ndk-r16b,对于 unity 2020,您必须安装android-ndk-r19

取决于您的操作系统和统一版本从 NDK 下载并安装有效的NDK

于 2021-10-11T17:37:31.490 回答