Unity 构建失败'Gradle 构建失败。 '

问题描述 投票:0回答:1
CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

stderr[
Note: D:\Freelance\FurryFriendFeeder\FurryFriendFeeder\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "C:\Users\salih\.android\debug.keystore": Keystore was tampered with, or password was incorrect

* 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

BUİLD FAILED in 22s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]

Observed package id 'platforms;android-30' in inconsistent location 'C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\Sdk\platforms\android-30' (Expected 'C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30')
Already observed package id 'platforms;android-30' in 'C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30'. Skipping duplicate at 'C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\Sdk\platforms\android-30'
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

> Task :launcher:packageDebug FAILED
41 actionable tasks: 41 executed
]
exit code: 1

我不能解决,我怎么能?

unity3d gradle
1个回答
0
投票

检查某些事情可能会有所帮助:

  1. 确保从 unity hub 正确安装了 Android SDK、NDK 和 JDK。
  2. 检查平台文件夹并确保最低和目标 API 级别存在于 android sdk 文件夹中的该文件夹中。
  3. 错误似乎是因为apk签名。查看密钥存储设置并确保分配的密钥存储存在。
© www.soinside.com 2019 - 2024. All rights reserved.