• 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 /
This question was closed Jan 04, 2018 at 09:13 PM by meat5000.
avatar image
0
Question by fuzzysmurf · Jan 04, 2018 at 09:13 PM · androidandroid buildandroidjavaobject

Unable to create/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 · Show 3
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 · Sep 30, 2017 at 05:37 AM 0
Share

Hi, will this post be approved?? Is there something I need to fix??

avatar image meat5000 ♦ · Jan 04, 2018 at 09:16 PM 0
Share

Was an apparent broken Post stuck in the cogs of moderation. Fixed; you know, just some housekeeping.

avatar image LMJ5631 · Jan 05, 2018 at 01:07 AM 0
Share

Don'T use JD$$anonymous$$ 9. Try to use JDk 8.

0 Replies

  • Sort: 

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

147 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

Related Questions

Multiple errors: Gradle/SDK/JDK related. Unity android build 5 Answers

Using CustomUnityPlayerActivity, which inherits from UnityPlayerActivity, will cause problems. 0 Answers

What I have to do to add com.unity3d to my Android game? 0 Answers

Compiling Android game doesn't work out 0 Answers

How to translate ArrayList to C# using AndroidJavaClass? 1 Answer


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