Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Cloud build failed: Only 8, 16, 24, or 32 bits supported: 872 #244

Closed
delanick opened this issue Aug 7, 2018 · 11 comments
Closed

Cloud build failed: Only 8, 16, 24, or 32 bits supported: 872 #244

delanick opened this issue Aug 7, 2018 · 11 comments
Assignees

Comments

@delanick
Copy link

delanick commented Aug 7, 2018

Hi all, I've researched this issue with my keystore file - I've seen and tried the suggestions in the articles about converting it and every attempt has failed. This is painfully frustrating and it's the last item on my project list before going live. Can someone please advise? Even if I need to send my .keystore to the {N} team and you guys do it for me - please!

@ggarabedian
Copy link
Contributor

Hello @delanick,

If you are going to publish your app for the first time, the fastest and easiest way to generate an Android certificate in P12 format is to do so directly with the Keytool (available by default in JDK). The exact command you need to use is outlined in this StackOverflow thread. IMPORTANT: I would recommend to use 10000 (or larger number) for -validity, otherwise, your certificate will be valid only for 1 year. After this time expires, you will not be able to use the certificate to update your published app anymore, because Android certificates cannot be extended or renewed.

Regarding the conversion process of a Keystore (or JKS) certificate to a P12 one, it's quite straightforward and as long as you know the password of the certificate and the alias name and password, you should be able to execute the command suggested here and convert the certificate successfully. Having said that, can you tell what is the exact problem that you experience when you run the command?

@delanick
Copy link
Author

delanick commented Aug 8, 2018

Hey @ggarabedian Thanks for responding!

I will try create the .p12 directly with your suggested approach and let you know!

That's just it, the command to convert says it ran successfully and the file is available in the location - but when using that file to create the release build I still get the same error. That was the source of my confusion...

@delanick
Copy link
Author

delanick commented Aug 8, 2018

@ggarabedian which of the approaches in that Stack Overflow thread you linked is the correct one? They talk about already having a .pfx not.p12 created. Or am I missing something? Apologies, still an amateur!

@ggarabedian
Copy link
Contributor

@delanick, you are correct and you just need to change the extension of the file that you want to create from .pfx to .p12. The -storetype pkcs12 is the flag that defines the type of the certificate, but the extension still needs to be .p12, otherwise, you will not be able to select it in Sidekick. Here is an example command:

keytool -genkey -alias mycertificate -keystore mycertificate.p12 -storepass mypassword -validi
ty 10000 -keyalg RSA -keysize 2048 -storetype pkcs12

If the name of your certificate contains a white space, you need to wrap it in quotation marks (""). Also, I recommend that you make the alias of your certificate and the file name identical as shown in the example above.

@delanick
Copy link
Author

delanick commented Aug 8, 2018

@ggarabedian your example command gave the following error feedback:

Nicks-MBP:MobiWashSA nickdelahunt$ keytool -genkey -alias mobiwashsa -keystore mobiwashsa.p12 -storepass Delanick!2345 -validi
-bash: !2345: event not found
Nicks-MBP:MobiWashSA nickdelahunt$ ty 10000 -keyalg RSA -keysize 2048 -storetype pkcs12
-bash: ty: command not found
Nicks-MBP:MobiWashSA nickdelahunt$ 

Do you know what the error is? I'm a CLI and Mac noob!

@delanick
Copy link
Author

delanick commented Aug 8, 2018

Ah nevermind. Sorting it out now

@delanick
Copy link
Author

delanick commented Aug 8, 2018

@ggarabedian Still getting event not found

@ggarabedian
Copy link
Contributor

ggarabedian commented Aug 8, 2018

@delanick,

The command is treated like two separate inputs when you copy and paste it from the provided code snippet. To circumvent this, you should either enter the command manually or copy it from below (where I have shared it as plain text):

keytool -genkey -alias mycertificate -keystore mycertificate.p12 -storepass mypassword -validity 10000 -keyalg RSA -keysize 2048 -storetype pkcs12

Additionally, if you are running on a macOS system and you would like to have an exclamation mark (!) in your password (or another special symbol), you must enclose the password in quotation marks ("") and escape the symbol with a backslash (\). For example: -storepass "Delanick\!2345".

Finally, please have in mind that you need to safeguard this file very well, because without it you won't be able to publish updates to your application.

@delanick
Copy link
Author

delanick commented Aug 8, 2018

@ggarabedian Thanks so much. I eventually seem to have got it right and have already safeguarded the file :)

Problem now is, with so many versions of the command before finally getting it right, I can't remember which command I used. So I've got to try it again and again now.

Althoguh, I could use this file to sign all my apps with Nativescript going forward, right?

@ggarabedian
Copy link
Contributor

@delanick, I am glad to hear that :)

And yes, you can use one certificate to sign and publish more than one application.

@delanick
Copy link
Author

delanick commented Aug 8, 2018

@ggarabedian you're a superstar!! Thanks bud, your help is much appreciated!! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants