How to sign Android App on another computer
Asked Answered
A

2

8

I'm using Flutter and I have an old Mac Mini that works fine but then Apple introduced a Signin with Apple and you can't build it on old version of Xcode, so I had to do it on my Macbook Air which I barely use to build apps because I feel more comfortable on desktop machine.

Now when I update something I had to push it on Github, then update the project and build the bundle on the Mac mini, because there's the cert I used to sign the App.

The problems is that I want to sell the Mac mini and I have a potential buyer but I don't know how to import the .jks in the Macbook Air. I tried simply copying it but it doesn't work. Can anyone help me with this, please?

Amaro answered 24/12, 2019 at 11:44 Comment(13)
I think we can simply copy-paste if it's not working you can do it with git, like a push in branch and take the pull from your MacBook.Greiner
I copied it but when build it, can't upload it on Play Console, because it doesn't recognize the key.Amaro
are you generating the build-in release environment and with the same .jks?Greiner
well, there's the problem I don't know how to import the .jks on another computer, copying it doesn't work.Amaro
Okay, So go to the build>Genertae Signed APK: Give your jks path in KEY-STORE PATH with key and passwords. You should be good to go.Greiner
I'm using key.properties file and there I have the key alias, the password, the path, etc.. First I used the .jks I've generated on my Macbook Air but it doesn't upload the bundle because of the differetn key, then I copied the .jks I have on the Mac mini and pasted it on the Macbook Air, then update the key.properties with the new pass and key alias etc., but it doesn't upload the bundle either saying that it doesn't recognize the key or something like this.Amaro
The key is not locked to any machine and can be copied; but what has XCode to do with it?! In case you've overwritten the correct one with a wrongful one, you might have a real problem (unless not using an upload key). Per default it's not even*.jks, but they're in the user-profile, in the .android directory.Kendy
I agree with Martin. The .jks is a file that should not be linked with XCode or your machine. Something wrong must happen somewhere else. Are you sure to have copied the right .jks ? It may be an obvious question but still ^^Barbican
When it was an "upload key", with the v2 signing, then it could be changed on the Google Play console - but when it was a "release key", then there's no way... but running Android Studio & Gradle on a Macbook Air is rather sub-optimal, because the performance cannot be compared to a desktop machine.Kendy
I see I might explained it wrong. Xcode has nothing to do. I'm just explaining why I had to copy the project on new computer and how it doesn't let me sign the Android App with the key I copied from the Mac mini.Amaro
Can you start copying the actual error messages you're getting? Perhaps the problem is with the Play Store login rather than the signing key? Also running the gradle builds in verbose mode on Air and new machines might help.Diminish
I hope it'll help you :developer.android.com/studio/publish/… to set the key stored path which you have copy your .jsk path and other fill other details.Jail
Ok, thanks all, I just tried it one more time and there were no problems at all. I don't know what I did wrong the first 2 or 3 times I tried to submit the app bundle. Sory about the inconvenience!Amaro
P
4
  1. Get the .jks you used to sign the android package
  2. Copy it to your /android directory of your flutter project
  3. Create key.properties file in the /android directory and insert the content as below :
storePassword=jks_password
keyPassword=key_password
keyAlias=key_alias_name
storeFile=../jks_file.jks
  1. Now run flutter command to generate apk or appbundle by below code

flutter build apk or flutter build appbundle

Pantisocracy answered 2/1, 2020 at 5:56 Comment(0)
S
0

I have faced this problem when I have to move my original flutter project to another project during the flutter 1.12 upgrade with conflicting plugins issues. I guess SHA1 fingerprints are generated with device and project configurations. so the best way is:

1) create new project and obtain new jks key 
2) change the package name of your project(sadly this would be new app in the playstore)

Use following command for creating the key in mac:

   keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Selie answered 1/1, 2020 at 6:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.