I am trying to implement AppInvites. I have gone through all steps written here https://firebase.google.com/docs/invites/android
And constantly get RESULT_CODE = 3, what have I done wrong?
Just to be sure it's not your code, you can download Firebase's quickstart samples from here: https://github.com/firebase/quickstart-android. Make sure to update the app-level gradle file with the right package name.
The guide you followed is a little incomplete, and doesn't explicitly mention the need to provide your app's SHA1 key when setting up your project in the Firebase console. Here's how to add the SHA1 key for a release certificate and a debug certificate to an existing Firebase project:
How to find the SHA1 for your keystore:
In command prompt, navigate to your Java installation. You'll be using Java's built-in keystore utility.
For the release certificate, type the following:
keytool -exportcert -list -v -alias <your-key-name> -keystore <path-to-production-keystore>
Note the SHA1 key it provides.
For the debug certificate, type the following:
keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
Again, note the SHA1 key it provides. Since this key is unique to each Android development environment, feel free to repeat this step for each environment you want to build from.
Once your have your SHA1 keys, enter them both into your Firebase project:
Go to your Firebase console.
Click on the three overflow dots on the project in question and click "Manage".
Click SHA1 and enter your first key.
Click SHA1 again and enter your second key.
From there, you just need to download the new google-services.json file and add it to your project's /app directory.
Related
I've published a few apps but eventually will need to do updates, most of the time it's fine, but soon enough.. I get an error when updating my app saying the fingerprint certificate is wrong. Answers all point to the need to save and reuse the original keystore or you're SOL. Just a few things to explain:
I have no clue what a keystore is.
I have no clue how to save it when making an app.
I have no clue how to restore it in future versions of my app that have used an alternate keystore for some reason or other.
What I'm trying to figure out is, what's the best practice to ensure that whenever I'm messing with my app to future develop it, how do I prevent changing this damn keystore? Is it whenever I update cordova? Update a platform? etc.. I feel like my apps have a ticking time-bomb that eventually stops it from being able to update on the Play Store. I'm using Cordova btw.
Been doing some research for about a day and a half before asking, so any help is appreciated.
Here's what I've gathered...
STEP ONE - CREATE A .KEYSTORE FILE:
Navigate to C:\Program Files\Java\jre7\bin (usually this), open command window and type:
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
STEP TWO - CREATING AN UNSIGNED VERSION OF YOUR APP
Build an unsigned version of the app in a command window that's opened in your project folder:
cordova build android --release
STEP THREE - SIGN THE RELEASE WITH YOUR SAVED KEYSTORE
Running the first command below will show all entries in your keystore, look for Alias name’ in the output, then use that value in the second command. In CMD:
keytool -list -v -keystore /path/to/your.keystore
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore /path/to/your.keystore android-release-unsigned.apk alias_name
STEP FOUR - CHECKING YOUR WORK:
Let's make sure everything was updated correctly before adding your app, otherwise you may run into this mess all over again.
First, unzip the APK and extract the file /META-INF/ALIAS_NA.RSA (this file may also be CERT.RSA or other, but there should only be one .RSA file).
Then issue this command:
keytool -printcert -file ALIAS_NA.RSA
You will get certificate fingerprints like this:
MD5: B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
SHA1: 16:59:E7:E3:0C:AA:7A:0D:F2:0D:05:20:12:A8:85:0B:32:C5:4F:68
Signature algorithm name: SHA1withRSA
Then use the keytool again to print out all the aliases of your signing keystore:
keytool -list -keystore my-signing-key.keystore
You will get a list of aliases and their certificate fingerprint:
android_key, Jan 23, 2010, PrivateKeyEntry,
Certificate fingerprint (MD5): B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
We can now determine the apk has been signed with this keystore, and with the alias 'android_key'.
Keytool is part of Java, so make sure your PATH has Java installation dir in it.
Store this somewhere you'll remember and use information where you'll remember (or safely store this info somewhere, a tattoo comes to mind).
STEP FIVE - ZIPALIGN YOUR APP: Navigate to your Android SDK folder and search for zipalign, use the most recent one. Then:
zipalign -f -v 4 "path/to/unsigned-apk" "path/you/want/signed/apk"
A lot of this info was found from all over stackoverflow, then compiled here for myself and others to reference in the future.
I was working with google map. In debug mode, it was fantastic. For release mode I tried to get the release SHA1 key from my windows10 hp probook. But i got some encrypted text instead of SHA1.
My command is as follows:
C:\Program Files\Java\jdk1.8.0_45\bin>keytool -exportcert -alias razon** -keystore E:\keystore\keystore.jks
The output was as follows along with some unknown signs that are unable to write here:
0S10 U8810dhaka10Udhaka10U
410608143654Z0S10 U8810dhaka10Udhaka10U
Then I created another API key for google map from Developer console with a SHA1, used previously in another project. With this API, the map is working in release mode but only in my device(Nexus 5, os6.1).
My Questions
How can I get the actual SHA1?
What can I do now? Please help.
You can use the keytool -list -v command (documentation):
keytool -list -v -alias razon** -keystore E:\keystore\keystore.jks
More easiest way:
Double click on the signingReport. You will see your debug and release SHA1 fingerprint. But before that you must have to set the keystore file from Project structure.
In order to do that, go to File>Project Structures...>app>Sigining>+
After that give a name and locate the store file(keystore or .jks) and provide your alias and password.
Then Click OK.
Then again go to File>Project Structures...>app>Build Types and there you will see debug and release. Select each of them and change the Sigining Config value to you newly created one.
When you sign and distribute your Xamarin Android apps the wizard helps you create keystore for your app. However, wherever I looked on my mac I could not find the actual .keystore file anywhere. So how am I supposed to get the SHA-1 fingerprint for that keystore?
SHA1 fingerprints are stored within the same keystore files.
Visual studio has an unique feature to open such files.
Just double click the file after creating it inside Xamarin. It will give you the SHA1 Fingerprint.
For windows users,
Go to this path or where ever you have your keytool.exe file
C:\Program Files\Java\jre7\bin
Hold shift key and right click -> then select Open command window here
After commandline open paste this command
keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Official document here - https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/MD5_SHA1/
This questions a few months old, but in the event others were stymied by this and end up here - here's instructions for mac users:
When you use the Android Signing wizard it asks for an alias and password.
Generate the SHA1 by entering by opening a terminal window and entering:
keytool -list -v -keystore /Users/[USERNAME]/Library/Developer/Xamarin/Keystore/[ALIAS]/[ALIAS].keystore -alias [ALIAS]
It will then prompt you for the password and if happy with that, will return certificate info and fingerprints (including the SHA1).
Note two passwords aren't needed as mentioned in the Xamarin documentation here.
(And if like me you were searching in Finder for the keystore file you created with no luck, it's because the Library folder is hidden)
I am a new to android application development. I want to release my app to market. Now I am working in Eclipse. I am stuck at the point of getting a keystore password. How to do this?
Here's an example of a Keytool command that generates a private key:
keytool \
-genkey -v -keystore my-release-key.keystore \
-alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Running the example command above, Keytool prompts you to provide passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called my-release-key.keystore. The keystore and key are protected by the passwords you entered. The keystore contains a single key, valid for 10000 days. The alias is a name that you — will use later, to refer to this keystore when signing your application.
For more information about Keytool, see the documentation at this link.
To create keystore refer this link.
You need to sign your app in release mode for that refer this link.
You can see the step by step detailed instructions with screenshots here.
Jsut check the below url
publish app
Compiling and signing with Eclipse ADT When using Eclipse with ADT, you can use the Export Wizard to export a signed .apk (and even create a new keystore, if necessary). The Export Wizard performs all the interaction with the Keytool and Jarsigner for you, which allows you to perform signing via a graphical interface instead of the command-line. Because the Export Wizard uses both Keytool and Jarsigner, you should ensure that they are accessible on your computer, as described above in the Basic Setup for Signing.
To create a signed .apk, right-click the project in the Package Explorer and select Android Tools > Export Signed Application Package. (Alternatively, open your AndroidManifest.xml file in Eclipse, open the Overview tab, and click Use the Export Wizard.) The window that appears will display any errors found while attempting to export your application. If no errors are found, continue with the Export Wizard, which will guide you through the process of signing your application, including steps for selecting the private key with which to sign the .apk, or creating a new keystore and private key.
When you complete the Export Wizard, you'll have a signed .apk that's ready for distribution.
and check below link
Signing Your Applications
Key to Keystore Android from my Windows 10 pro:
Open your command prompt
Type: cd\
Type: cd\
Type:
cd Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\"your username_of_your_pc_login_without_quotes"\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
No map shows up but a grid. So I looked up some sample fixes and came to this
help needed to publish android app in market
however, after running the cmds as suggested, I end up with a SHA1 certificate fingerprint. But when I go to sign up for a google API key, I see I need an MD5 certificate fingerprint instead. How do I tackle this please?
And here is the solution to your problem
Open Command Prompt and navigate to C:\Program Files\Java\jre6\bin(might be different in your case).
As you are following this solution that means you have keystore with you.If yes move to step 3. else create a new keystore like mentioned in this.
Type the following command keytool.exe -v -list -keystore " <path_of_keystore_youhave_created_in_step_2>" it will ask for password use the same password you have used while creating keystore and you will get SHA1 MD5 and many information you have provided while creating keystore.
First find the location of debug.keystore (In eclipse you can find location of debug.keystore at Window->Preference->Android->Build).Then navigate the path of keytool.exe in command prompt. keytool.exe is located inside Java –> JDK – > bin folder inside program files.
For window write the following code in command prompt C:\Program Files\Java\jdk1.6.0_25\bin> keytool -list –alias androiddebugkey -keystore <path_of_debug.keystore> -storepass android -keypass android
Here <path_of_debug.keystore> is path of debug.keystore. For my case it is C:\Users\virus.android.
Copy the MD5 key(eg:- BE:05:C8:F2:42:7A:97:37:78:EE:BD:4A:31:7D:A6:69) and goto on following link to find google map api key http://code.google.com/android/maps-api-signup.html