Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by BarneyW · Jun 20, 2014 at 11:45 AM · signing

How to sign APKs for publish when using BuildPipeline.BuildPlayer

I was wondering if there are any particular steps I need to take to successfully sign APKs when using BuildPipeline.BuildPlayer()?

I have successfully built and uploaded APKs when using the "build" option in the editor but when building via BuildPlayer() I get an "Unable to read " followed by "Keystore was tampered with, or password was incorrect" but the password entry in the editor hasn't been changed since the last successful build. PlayerSettings.keystorePass and PlayerSettings.keyaliasPass are set to the correct values, it is as though they just aren't being picked up.

Using an unsigned alias with BuildPipeline.BuildPlayer() also works just fine. Is it the case that I have to build an unsigned APK then sign it via the command line as in the following post?

http://forum.unity3d.com/threads/signing-package-from-the-command-line.162448/

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 Denvery · Jun 20, 2014 at 08:36 PM 0
Share

Please check if the keyalias and keystore are set to the correct values. Remember that keystore must be a string with full path to file...

avatar image BarneyW · Jun 23, 2014 at 08:36 AM 0
Share

Hey Denvery, is there some way of setting the keystore path in code? The only place I can see is through the editor in "Player Settings". The path I have set there works just fine when I do File->Build Settings->Build but if I call BuildPlayer() without changing any settings it fails.

avatar image BarneyW · Jun 23, 2014 at 10:05 AM 0
Share

Strangely this seems to have just started working this morning. Can't identify what was causing the issue before.

2 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by Denvery · Jun 24, 2014 at 10:16 AM

Hi BarneyW, this is an example of signing APK from code:

         PlayerSettings.Android.keystoreName = keystoreName;
         PlayerSettings.Android.keystorePass = keystorePassword;
         PlayerSettings.Android.keyaliasName = keyAliasName;
         PlayerSettings.Android.keyaliasPass = keyAliasPassword;


We write these lines inside C# script and call these function when we are building. keystoreName contains full path to keystore file. May be this will help you a bit:)

Comment
Add comment · Show 1 · 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 CrandellWS · Nov 18, 2017 at 08:24 PM 0
Share

https://answers.unity.com/answers/969497/view.html

avatar image
-1

Answer by JigneshKoradiya · Jul 28, 2015 at 09:50 AM

you have to visit this video to understand keystore :

https://youtu.be/iBmgCnJ_z1k

you can sign the apk with keystore

Comment
Add comment · Show 1 · 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 rain03 · Dec 10, 2015 at 12:07 PM 1
Share

i'd downvote this answer if i could...

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

6 People are following this question.

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

Related Questions

Installation of signed Android build fails 2 Answers

Can't login into Unity Editor 4 Answers

I get the error launcher:signreleasebundle 0 Answers

[Android] Escape characters for the password of my alias key 0 Answers

Where to get The alias password while app signing in unity 2 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