Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by fuzzysmurf · Oct 02, 2017 at 02:07 AM · androidandroid buildandroid sdk

Unable to Create or Sign APK File for Android

Hi,

My Question is.... What am I missing?!? What's wrong!!!!!!!!!!!!!!!

I have been trying for quite some time to build to Unity, and everytime I do, it keeps failing over and over. I have tried several things, and to no avail. I keep getting a "Failed to Sign APK Error".

I have JDK-9 installed, with Environment Path set to JDK-9, and unity external Tools set to JDK-9.

In Environment Variables I have:

  • Variables: JAVA_HOME Value set to "..\Java\jdk-9\bin" (I have also tried "..\Java\JDK-9"

  • Variables: PATH Value set to "..\Program Files\Java\jdk-9\bin"

SYSTEM VARIABLES:

  • Variable JAVA_HOME set to "..\Java\jdk-9\bin"

  • Variable PATH set to "..\Java\jdk-9"

I have Android SDK, Build Versions 16, 25, 26, full. I have NDK as well (although i dont think its needed).

UNITY

In Unity I have UnityPreferences / External Tools set too:

  • Android SDK : "../AppData/Local/Android/sdk"

  • JDK: "../Java/jdk-9"

  • NDK: "../android-ndk-r10e"

PLAYER SETTINGS:

  • Version: 0.1.0

  • Min API: 4.1

  • Bundle Version Code: 1

  • Target API: Automatic

  • Script Runtime: .NET 3.5 Stable

  • Scripting Backend: Mono

  • API Compatibility: 2.0

Keystore is browsed to correct directory. keystore password is correct (attempted to remake it 4x incase it was wrong, also have keystore pass, and key-pass matching just in case) I have tried Unsigned, and Signed Keys.

I have tried both Internal, and Gradle. (gradle is still to new to find enough info on it, so only tried once and stopped).

This app is not on the google play store, just simply testing. I have tried signing it in different ways, matching passwords, etc, and it still fails. Below is the error I get.

I have also tried updating the Android SDK Tools Folder in the Android SDK directory to previous version of 25.2.5 as indicated in several forum posts like this one:

  • https://stackoverflow.com/questions/42538433/not-finding-android-sdk-unity


    CommandInvokationFailure: Failed to sign APK package. C:\Users\alexm\AppData\Local\Android\sdk\build-tools\26.0.1\apksigner.bat sign --ks "D:/1 - Unity Projects/UntilYouDie/UntilYouDie/DeploymentDocs/user.keystore" --ks-pass pass:"fuzzysmurf123" --ks-key-alias "until you die" --key-pass pass:"fuzzysmurf123" "D:\1 - Unity Projects\UntilYouDie\UntilYouDie\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(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Exception in thread "main" ] stdout[

    ] exit code: 1 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg) 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) UnityEditor.HostView:OnGUI()


I'm at a loss. any help would be appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by EdwinChua · Oct 02, 2017 at 02:22 AM

Hi, I think your problem is with this:

com/android/apksigner/ApkSignerTool : Unsupported major.minor version 52.0 at ...

Please refer to the solutions described here: https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fuzzysmurf · Oct 02, 2017 at 03:49 AM 0
Share

You know, I think that did the trick, and the project Builds now, but wont install on the phone. I now get a:

 Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
avatar image EdwinChua fuzzysmurf · Oct 02, 2017 at 03:54 AM 0
Share

Have you tried this? https://stackoverflow.com/questions/15636396/failure-install-parse-failed-no-certificates-when-attempting-to-install-apk-to

avatar image
1

Answer by pazgamestudio · Mar 05, 2018 at 03:25 PM

Add the variable as shown below. change to new version of your java ,for me is: jdk1.8.0_65 (make sure restart pc) good luck.:)

alt text

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by lingmaaki · Oct 30, 2019 at 12:35 PM

It is because of Java version mismatch. Unsupported major.minor version error happens when you compile your projects on higher version of java(e.g. jdk 1.8) and then run it on a lower version (e.g. jdk 1.7). Depending on your situation, you have two ways to resolve this error: compile your code for an earlier version of Java, or run your code on a newer Java version. Sometimes you may have more than one version of Java SDK installed in your machine. Make sure the application you are running is pointing to the right or highest version available . It is better you need to install both JRE/JDK with the same version.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

150 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

MissingMethodException: get_vuforiaEnabled() 3 Answers

Cannot install apk in android 8.0.0 (API level 26) 0 Answers

Cant find android SDK root folder when first trying to build for android 3 Answers

Android build problem when I clear app data? 0 Answers

4 errors after implementing unity ads in my game. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges