Release and debug version of the application in Android. Two certificates - android

I have created release (exported) version of the app. That created problem that debug version uses debug certificate for signing and exported version uses different certificate.
Is it possible that they both use the same release version certificate?
If yes, then is it possible to save certificate password, so I don't have to type it every time I export (or compile) application?
If this is not advised or impossible, then how do you deal with Android shouting about Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES] every time you want to install release app into device which already has debug app installed?
And how do you deal with Android Google Maps API V2 not working with debug certificate, because AndroidManifest.xml has the key which works only with app signed with release certificate?

You can automate your build process with gradle or ant. Once you do that its easier to build the signed apk. Using the latest Android studio you can create multiple versions of the same build at a time.
This question and its answers will help you resolve this .

To answer.
If a app is signed with same certificate it won't cause any issue, and basically there can never be two version of same certificate. Second, yes by default sdk use debug certificate to sign your application , and while releasing its on you to choose which certificate to sign.
You can create a batch file with predefined command to Sign you application, all you need to do is
a. release your application raw, withouht signing
b. Use Jarsigner, and your custom made certificate to sign it
c. Use Zipaligner to optimize it, you can easily club this command in a batch file (in windows)
This error shows up when, already installed same application carries a signature of different certificate then what you are trying to push again, so either you remove preinstalled app manually and install new one, or sing the new app with same certificate in push it into device.
You can very well integrate Google Maps APIv2 with debug key, all you need to do is to register your app with google using hash of debug key and using generated key in your app.

Related

Google Sign In doesn't work with Trusted Web Activity (TWA) release apk but works in debug apk

I am using Trusted Web Activities(TWA) for the Android app. My app uses Google Sign In for Authentication (Firebase). In debug mode, it works as it should. But when I install the release apk and try to Sign In, authentication fails and the app restarts.
I do know that you need to add SHA-1 fingerprint in the Firebase Project settings for your app, but my project is a web app and there is no option to add fingerprint for the same.
There's no difference on the browser side between a debug and a release APK. What seems to be happening in this case is that the package signature (and the SHA-256 fingerprint) are different, which cause the Digital Asset Links validation to fail in the release APK and causes the content to be opened in a Custom Tab.
You can use Peter's Asset Links Tool to get the SHA-256 fingerprint for the release APK installed on a device, then update .well-known/assetlinks.json accordingly.

I am trying to upload my APK into the Playstore but it is not working... :(

I am trying to upload my app to the playstore but when I upload the APk this error appears, "You uploaded an APK or Android App Bundle file that was signed in debug mode. You must sign your APK or Android App Bundle in launch mode." I am not sure what to put in the com.company.name thing, or if that is the problem or not.
I did the app using Unity and I am not sure if maybe I did a mistake when I was building into the APK. This is the first app that I publish an APP and it is for a school project. Any help on the subject would be great.
In Android, you create something called a KeyStore. Android Studio creates a debug KeyStore by default, and most people don't even think about it. However, if you want to 'Release' your app to the public, you need to 'sign' it with a 'Release KeyStore'. So, Google how to create a Release KeyStore, and do that first. Then, when building your app for release, at least in Android Studio, you would go to Build/Generate Signed Bundle/APK. Then, you would select your Release KeyStore and enter the passwords and alias. This will then sign your app for Release, and you'll be able to upload it to the App Store.
You need to sign your app with a unique key. You can read more about it here - https://developer.android.com/studio/publish/app-signing
Here you can see how to sign your app in Unity: https://answers.unity.com/questions/326812/signing-android-application.html?childToView=600281#answer-600281

How can I work with google play service on different computer

I got the SHA1 using this:
How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
and then I did a setup for google play service and everything works fine.
When I run the app from my android studio but when I go to the other pc and tries to run the app its says "failed to sign in". So my question is how can I work in two different workstation and have the same signed app? I also tried to sign the app with the Build > Build signed APK and it didn't work.
When you running the app in debug mode via Android Studio, the apk is signed with the debug key. For each computer, the debug key is different. The debug key is placed in $HOME/.android/debug.keystore. So you need to use the same debug key by copying the key to another computer.
To build an apk with signed key, you need to generate your key first. Please see in Sign your release build.
Please ensure you are using the same key to sign the APK. Transfer the KeyStore (.jks) file to the new computer you'd like to sign the app on. Be sure to enter the correct password which you assigned when creating the KeyStore as well. For more information, see the docs.

ADT: Can i use the key used to sign debug versions for signing manual builds?

I have a programm with an auto-updater and till now I deployed programm versions generated by the eclipse "Run" and "Debug" commands for my beta testers. (poor decision - as I know now)
Now I want do deploy versions that have been created by the "Export" command, but without the need for my testers to uninstall the app priror to installing the new version. To achieve this I would need to sign the apks created by the "Export" command with the key that is used for the automatic debug builds.
Is this possible? - If yes: how would i do that and where can I find the key that is used for this automatic builds?
best regards
You can find the automatic debug key from ~/.android/debug.keystore . If you are using eclipse you can set the path to a custom keystore (if you are so inclined) from Windows->preference-> Android->Build. But the disadvantage of using the debug key is that 1)it is valid for 365 days only. 2) You can't publish your app to play store. and others which I can't recall.
http://developer.android.com/tools/publishing/app-signing.html has all he details about signing your app.

Android Application Signing

It is written in App-Signing that
The Android system will not install or run an application that is not signed appropriately.
But, I am wondering why I can still run an unsigned application in the emulator. I am thinking that signing of an application is only needed when publishing the application. Is my understanding correct?
Thanks,
artsylar
The android system checks your application certificate every time you install it. When you run an application on emulator, IDE signs it for you with generated debug certificate.
You can see that it is true by performing an experiment:
From one computer install an application using IDE on your device.
Then try to install the same application from another computer. You will get an error while installing : wrong certificate.
Remember, that this debug certificate is valid until you want publish the application. Then you will need to create a keystore and properly sign the application. Don not forget to backup the keystore!
Yes...
If you are running over the emulator no need to sign the app because android build tool will do that automatically.
If you want to make it available to end users you must sign it with your private key to avoid tampering of an application.
The application you are using in the emulator is signed at compile time with a debug certificate. So the app is signed but out of simplicity this is done automatically for you.
check this question
Note that "unsigned" is probably not what you are referring to here. When you create an APK during the normal development process, it is signed by a debug key. Such APKs can be distributed but will not work, for example, on the Android Market. A truly "unsigned" APK can be created, but it cannot be installed unless you manually sign it

Categories

Resources