0 votes
by (120 points)
recategorized by

目标 API 27会失败,切换到Automatic或高API级别时就不报错了

Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details

Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01

3 Answers

0 votes
by (1.1k points)

可能是环境没配好,Android SDK装29了嘛

enter image description here

by (120 points)

为此我把26到32都装了一遍,然而都出现一样的错误,里面只有pico sdk没别的sdk,难道你们都能打包成功吗?
环境没配好?环境配置的是jdk呀!为什么切换到Automatic或高API级别时就不报错了?

by (120 points)

错误日志里看看有没有:Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK
这个是需要删除 API 31 的 当前版本好像有问题

by (120 points)

Invalid keystore format 还有就是 不要用默认的keystor 自己创建一个

by (120 points)

有是有,也删除过,需要用29替换,不然自己会蹦出来,但又出来以下错误:

Starting a Gradle Daemon, 1 incompatible and 6 stopped Daemons could not be reused, use --status for details

Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:unity-android-resources:preBuild UP-TO-DATE
Task :unityLibrary:unity-android-resources:preReleaseBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:unity-android-resources:compileReleaseAidl NO-SOURCE
Task :unityLibrary:unity-android-resources:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:unity-android-resources:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResValues
Task :unityLibrary:unity-android-resources:generateReleaseResValues
Task :unityLibrary:generateReleaseResources
Task :unityLibrary:unity-android-resources:generateReleaseResources
Task :launcher:generateReleaseBuildConfig
Task :launcher:compileReleaseAidl NO-SOURCE
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :launcher:generateReleaseResValues
Task :launcher:generateReleaseResources
Task :launcher:createReleaseCompatibleScreenManifests
Task :launcher:extractDeepLinksRelease
Task :launcher:javaPreCompileRelease
Task :launcher:prepareLintJar
Task :unityLibrary:packageReleaseResources
Task :unityLibrary:extractDeepLinksRelease
Task :unityLibrary:unity-android-resources:packageReleaseResources
Task :unityLibrary:unity-android-resources:extractDeepLinksRelease
Task :unityLibrary:generateReleaseBuildConfig
Task :unityLibrary:unity-android-resources:generateReleaseBuildConfig
Task :unityLibrary:unity-android-resources:compileReleaseLibraryResources
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:unity-android-resources:javaPreCompileRelease
Task :unityLibrary:unity-android-resources:prepareLintJarForPublish
Task :unityLibrary:mergeReleaseShaders
Task :unityLibrary:unity-android-resources:mergeReleaseShaders
Task :unityLibrary:compileReleaseShaders NO-SOURCE
Task :unityLibrary:unity-android-resources:compileReleaseShaders NO-SOURCE
Task :unityLibrary:generateReleaseAssets UP-TO-DATE
Task :unityLibrary:unity-android-resources:generateReleaseAssets UP-TO-DATE
Task :unityLibrary:unity-android-resources:packageReleaseAssets
Task :unityLibrary:unity-android-resources:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:unity-android-resources:bundleLibResRelease NO-SOURCE
Task :unityLibrary:unity-android-resources:mergeReleaseJniLibFolders
Task :unityLibrary:unity-android-resources:parseReleaseLocalResources
Task :unityLibrary:unity-android-resources:processReleaseManifest
Task :unityLibrary:unity-android-resources:mergeReleaseNativeLibs
Task :unityLibrary:unity-android-resources:stripReleaseDebugSymbols NO-SOURCE
Task :unityLibrary:unity-android-resources:copyReleaseJniLibsProjectOnly
Task :unityLibrary:unity-android-resources:generateReleaseRFile
Task :launcher:processReleaseManifest
Task :launcher:checkReleaseDuplicateClasses
Task :launcher:mergeReleaseShaders
Task :launcher:compileReleaseShaders NO-SOURCE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :launcher:collectReleaseDependencies
Task :launcher:sdkReleaseDependencyData
Task :launcher:mergeReleaseJniLibFolders
Task :unityLibrary:packageReleaseAssets
Task :launcher:validateSigningRelease
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResRelease NO-SOURCE
Task :launcher:mergeReleaseResources
Task :unityLibrary:unity-android-resources:compileReleaseJavaWithJavac
Task :unityLibrary:mergeReleaseJniLibFolders
Task :unityLibrary:javaPreCompileRelease
Task :unityLibrary:compileReleaseLibraryResources
Task :unityLibrary:parseReleaseLocalResources
Task :unityLibrary:unity-android-resources:bundleLibRuntimeToJarRelease
Task :unityLibrary:unity-android-resources:bundleLibCompileToJarRelease
Task :unityLibrary:prepareLintJarForPublish
Task :unityLibrary:generateReleaseRFile
Task :launcher:mergeReleaseAssets
Task :launcher:processReleaseResources FAILED
Task :launcher:desugarReleaseFileDependencies
Task :unityLibrary:compileReleaseJavaWithJavac
Task :unityLibrary:mergeReleaseNativeLibs
50 actionable tasks: 50 executed

UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
PvrUnitySDKBuildCheck:OnBuild (UnityEditor.BuildPlayerOptions) (at E:/Unity Projects/VRTest/Assets/PicoMobileSDK/PvrUnitySDK/Editor/Pvr_UnitySDKBuildCheck.cs:110)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

by (120 points)

我又试着用30替换,还是一样,keystore也创建了

by (120 points)

可以告诉我一下2020那个版本能用吗?我好单独下载一个

0 votes
by (1.1k points)

我也是碰到了这个错误,用的Unity 2020.3.22。Gradle文件选择的是Unity下载的,应该是6.11的版本。Android SDK下载了31.0.0。但是我看网上说主要是SDK构建工具31上缺少2个文件,即1.dx.bat2.dx.jar,解决方案是这些文件在文件位置中被命名为d8,因此将它们的名称更改为dx将解决错误。
步骤如下:
1)进入C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0目录
2)找到一个名为d8.bat的文件,这是Windows批处理文件。
3)重命名d8.bat为dx.bat。
4)进入C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0\lib目录
5)在将d8.jar重命名为dx.jar
这里面的路径是你对应的Android SDK的路径。参考的是这个博客的评论。
然后就打包成功了。

0 votes
by (200 points)

可以换下26试试,感觉27是不是有什么问题

...