Generating apk and test in android smartphones not work - android

I created an android application to connect external sql server over WiFi and fetched some data and displayed. I generate its apk via Build>Build apk. It creates apk folder in output folder of build which contains 'app.debug.apk' and 'app.debug.unaligned.apk'. I installed it in my android smartphone. The app is opened and shows layout. It doesn't shows any error message. But I can't fetch my data from sql server.
I don't know what is the problem with that.
Help me.

You need to follow steps for generating signed APK:
Click on Build > Generate Signed APK in the menu.
Click Next to build an APK for the app module.
Click on Create New to create a new keystore file.
Fill in the fields to create your keystore and key as appropriate.
Generate your signed APK.
For pictorial representation and more detailed answer please refer this link : How to generate signed APK

Related

Google Console APK Upload - New App fails

Recently trying to create a new App and upload a brand new APK with self signed certificate (Not Google App Signing) Results in the following error
You uploaded an APK or Android App Bundle that is signed with a restricted certificate. You need to upload an APK or Android App Bundle signed with your own certificate.
I don't believe this error is entirely correct as I do sign the certificate myself locally, this seems like a recent change to our on boarding process and opt-in is now default for google app signing but our infrastructure doesn't have the right pipeline for this yet.
Is there any other things to verify and test, as I see the keystone file is still there and there's no build errors when it's being signed. Also this is a brand NEW application I don't understand why this error would occur for the initial upload since there's no other keys to check against.
I've searched the net but most issues appear to be happening in 2018 and this is more of a recent change that started to occur for us.
EDIT: This is using Cordova build tools not through Android Studio.
Try to follow these trouble shoot steps and see if that will solve your issue:
Clear everything in the Release folder, present in app->build->outputs->apk->release.
Generate new signed apk which will get created in the same above mentioned directory.
Make sure you are bumping the version code.
I don't have a full answer as to Why it was failing, however right after the build for cordova build android --release that APK will upload. But If I use that APK in an emulator to test something first that APK is no longer valid to upload and I get the error pasted above.
basically in our pipeline I had to create a copy of the APK right before creating screenshots and then use the copied APK to upload onto google console.

How do I generate application installer in android studio?

I've developed an application in Android Studio and now I'd like to generate the apk.
I followed some tutorials where I went in Build -> Generate Single Budle ... and a ".jks" file is generated.
Is this file that I should copy to my mobile phone? If so, how?(a message appears saying that the file is not supported).
Everything is very simple.
Build -> Generate Signed Bundle / APK -> Set APK
Use your key or create new *this key is your digital signage
After Successful build you can find your APK file inside the project folder itself.
(path: project_folder/app/release/apk-release.apk)
Put attention to digital signature! If you are publishing your APP in Google Play store, then you should keep that file safely. If you lose your key,then you can't submit any updates to your App. Even nunky from Google can't to do anything. Keep it in a safe place.

Changing Signatures in APK file Android studio

I recently made my first app in Android Studio and made it into an APK. Google play said I had the wrong signature for the APK but I don't know how to change the APK with different signatures nor revert the program back in order to manually change it inside Android Studio. Any help on this?
Here is step by step what I did to get to this point. I finished writing my program and went to "build" then "generate signed apks" where I went through the process of making the keys, key store etc. At this point everything is fine. I just need to somehow go back into the apk and either change the signatures of it or unpack the apk in studio and redo the process of generating signed apks.
You need to sign the apk with the same public-key certificate which you use in the previous uploaded apk. When you build the release apk via Build -> Generate Signed Apk.., you will be presented with the following dialog:
Then you must use the same certificate file (something like android.jks) for the Key store path.
The documentation says:
Every app must use the same certificate throughout its lifespan in
order for users to be able to install new versions as updates to the
app. For more about the benefits of using the same certificate for all
your apps throughout their lifespans, see Signing Considerations
below.
So, if you lose the certificate file, there is no way you can upload the apk with the same package name again. It will lose forever, gone. You also can't delete the published apk to reuse the same package name again.

This app is not authorized to use Firebase Authentication. Verify that the correct package name and SHA-1 are configured in the Firebase Console

I have attached firebase on my modified Q-Municate app which is open source on Github of android project and ran it. Here is the scenario: If the app ran from android studio via developer mode, it(Firebase sign in via phone number) runs smoothly and I manage to log in.
I also build signed debug apk and upload on Playstore and after that I saw this issue. Later, I build again signed debug apk for testing in phone, but Firebase does not allow to sign in. It gives the following message1.
You need to verify in fire base console if the sha1 of your default debug or production key has been saved in the firebase console project -> project->package - >settings
While creating your configuration file use package name used for your starting activity e.g. If starting activity is MainActivity.java then use package name provided at 1st line of this file. DO NOT ADD FILENAME. And again generate configuration file.
After creating configuration file copy it in app folder of your android project.
You should set SHA1 as answered Niraj Sanghani. Pay attention, you should generate SHA1 for all keys, which used for signing your .apk. There is simple method for generating SHA1 via Android Studio.
Possible answer solved here.
try to synchronize the key by accessing:
Tools>Firebase>Authentication>Connect>Sync

How to give android apk to client for testing purpose?

I am developing for an application currently.
But when i will finish my app developement and i create .apk, should i sign it or make it unsigned while giving my app to my client for testing on their own devices??
He should not be able to put this apk on market as an author/ He should not distribute without my permission.
Any suggestions are welcome.
Thanks.
You can sign with your debug key which in windows resides in: username/.android/debug.keystore
Password is: android
Sec password is: android
Edit: But if the person has some knowledge he can just resign it with another key, you can't really protect yourself against this (afaik).
Steps:
In Android Studio Generate Build APK
Build -> Build APK
You get popup once apk is generated
Build APK
Apk(s) generated successfully.
Shown in File Manager.
Goto https://www.diawi.com/ and signup if if you are a new user, else login.
In above link you may find option "Upload your app".
Inside that box you ma find "Drag&drop files here .ipa or .zip(.app) .apk"
So Drag and Drop apk file or Browse apk file using + Add file(s) button.
After uploading apk Click on Send button.
This will generate a URL and Barcode.
Share that URL with a person who want to test the build.
you don't need to sign using debug key, android sdk does it automatically, and android applications signed by debug key is not possible to upload on market, you can get apk file in bin directry of your project.
file-> export
click on android
select "export android application"
specify the path

Categories

Resources