Deploying Android App (developed in Delphi FireMonkey) to Google Play Store - android

I am attempting to deploy my first app to the Google Play Store. Each time I upload the APK file, I get the following message:
"Upload failed You uploaded a debuggable APK. For security reasons you
need to disable debugging before it can be published in Google Play.
Learn more about debuggable APKs."
I am building a release version of my code. I upload the release version of my APK file from:
\Projects\MyAppNameHere\Android\Release\MyAppNameHere\bin\MyAppNameHere.apk
In my Projects Debugging options, it is set to "No Debug information"
I have also modified the AndroidManifest file to say:
android:debuggable="False"
However, the Google Play Store keeps giving me the same message that i need to upload a non-debuggable version.
What Am I doing wrong? I should note, every time I build a new release version of the APK file, the AndroidManifest file reverses back to
android:debuggable="True"

There are two types of certificates for signing your app:
Debug certificate: to connect a debugger to your application, to be able to access your apps's private data directory
Release certificate: to upload your app to an application store (like Google Play)
Delphi puts a debug certificate for you on your PC so you can start developing & debug your apps.
It even uses this certificate if you compile with a release profile when you forgot to create your own certificate.
So make sure that
Your build configuration is set to "release"
Your Target Plattform configuration is "Application-Store"
You have provided an own certificate for this configuration in Project -> Options -> Deployment (make sure your profile is Release Configuration - Android Platform)
If you do not have a release certificate you can create a new certificate within a key store through the options dialog. Remember to always use the same release certificate for your app, and to store your key store in a secure place that no other person has access to it. Once you lost that certificate, you will not be able to publish updates of your app anymore!
If you like to install your release app on a device that already has installed a debug version of your app, you have to uninstall it first.
If you like to verify what certificate an .apk is signed with you can use the command
jarsigner -verify -verbose -certs %file_name%

Related

Firestore Release APK Doesn't Read and write But Storage Works Flutter

I am using firestore and storage for my flutter android and ios app. On debug mode everything is fine, reading and writing to firestore and storage works. But when turning to release mode on android firestore reading and writing dont work. What could be the case?
I could not finish my project for a long time. Your help is really appreciated.
When running project by typing following command, no error occurs.
flutter run --release
Build apk with following command :
flutter build apk --release
On your Android Apps Configuration in Firebase Console, under General Tab, you have to add SHA fingerprint for your app's release version.
You can find your SHA fingerprint certificate for your released app under Setup, App Integrity from your left menu in your Play Console.
It will works with either your SHA-1 or SHA-256 fingerprint certificate.
EDIT Above will works if you publish your release app through Google Play signing.
If you distribute your release app by yourself, you can check the SHA-1 fingerprint certificate from your project's gradle signing report. In there, you can find it for the Variant : Release

Update application enrolled in Google App Signing

I have an application enrolled in Google App Signing, so the signature of the delivered APK will be different from the signature of the uploaded APK. I currently have the production APK installed on my android device and I'd like to run the app from Android Studio without losing the data, so I need to use the same SHA-1 to update the application.
If I run the application from Android Studio, with the release build type, the APK is automatically signed with the keystore that I used for the upload on Google Play Console. The SHA-1 is different from the one auto generated by Google App Signing, so Android Studio asks to uninstall the existing application:
Installation did not succeed. The application could not be installed:
INSTALL_FAILED_UPDATE_INCOMPATIBLE The device already has an
application with the same package but a different signature.
This is allowed for the applications that are not enrolled in Google App Signing, because the keystore SHA-1 is always the same. Is there a solution to this?
I tried to download the Upload certificate from Google Play console and add the certificate to my current keystore file, but it didn't work:
keytool -importcert -file upload_cert.der -keystore keystore.jks
There is no way to get an APK signed with your release key other than by uploading an APK to the Play Console if you opted for Google to generate the signing key.
However, there are good other testing processes you can set up which should hopefully help you. Make sure to differentiate your iterative local tests from your release QA (i.e. shortly before the release):
In the former case (iterative local builds), you should always test with a debug key, and you can also test the upgrade flow from one version signed with the test key to another version signed with the test key.
In the latter case, shortly before you release, you should upload an APK to the Play Console to a closed track to test exactly what will be served by the Play Console, and you can do a final check of the upgrade flow on a released app.
(Note that the internal testing track will not help you test the upgrade flow from a release-signed APK since the APK signed by Play in this case is a debug key and not your release key, so make sure you use a closed track instead).
Hope that helps.

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.

How to update Play store downloaded APK from ADB android studio generated APK with with same key store

Earlier PlayStore downloaded APK can be replaced by android studio generated APK with same key store via ADB command.
But now after google app singing opt-in am not able to override the APK.
How to update the google derived APK from original APK via ADB command
#Pierre is right. I found a workaround for this. Here's how
Go to releases in Google Play Console
Create a new release upload your APK, then delete your your release
Then go "Artifact Library" (still under "Release Management")
Find your APK there click the ↓ to download it choose "Derive APK" you can identify by it's version code
This will update your existing APK from Google Play via ADB without a problem
Edit: based on #Jarvis comment
No you can't debug the APK you download from "Artificat library", if you would like to have both release and debug versions I suggest you create different package names based on the build, you can do this in gradle like:
buildTypes {
release {
// Yada yada, nothing to add here
}
debug {
applicationIdSuffix '.debug' // This will add .debug to your original package name
versionNameSuffix ' - DEBUG' // The will -DEBUG to your version name
}
}
The reason you're not able to update is that the APK installed on your device is now signed with the upload key whereas Google signs the APK with the release key, and Android doesn't allow updates on an app if the newer APK isn't signed with the same certificate.
You have a couple of options available:
- If you have kept a copy of your release key, you can keep signing your APK with that key on Studio for your local testing. The downside is that you'll have to build two separate APKs: one to install on your device (signed with the release key) and one to upload on the Play Console (signed with the upload key).
- Reconsider your testing flow so that you only install on a given device APKs coming from a single source, either Studio or Play.
Hope that helps.

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

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.

Categories

Resources