团结| Android - 无法签署APK packag:不支持的major.minor版本52.0

时间:2018-02-02 21:01:43

标签: java android unity3d

我正在尝试在Unity(2017.3.0f3)中构建我的apk但是我得到错误Unsupported major.minor版本52.0。我已经读过其他地方修复此下载Java JDK 8并选择路径。我用不同版本的Java 8完成了这个,但没有一个正在工作。我已经尝试更新我的所有Android SDK包但Unity不会基于最新的SDK工具,所以我不得不用以下统一答案页面中指定的Revision 25。2。5(2017年1月)工具替换它们:

Unity Answer Page

我现在不知所措,任何建议都表示赞赏。感谢。

当前设置:

enter image description here

错误日志:

    CommandInvokationFailure: Failed to sign APK package.
C:\Users\Jack\AppData\Local\Android\Sdk\build-tools\27.0.3\apksigner.bat sign --ks "E:/JRFApplications/Keystore/jrfapplications_2018.keystore" --ks-pass stdin  --ks-key-alias "eggscapade" --key-pass stdin  "E:\JRFApplications\Apps\Egg\Temp/StagingArea/Package.apk"

stderr[
java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Exception in thread "main" 
]
stdout[

]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.RunWithStdin (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg, System.String[] input)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg, System.String[] stdin)
UnityEditor.Android.PostProcessor.Tasks.BuildAPK.SignPackage (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.Tasks.BuildAPK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

安装和测试的JDK版本未成功:

enter image description here

1 个答案:

答案 0 :(得分:0)

我设法通过在构建设置

中将统一构建系统从内部更改为Gradle来解决此问题