I build react native app with react-native-firebase and I generate sha1 by these steps
run project in android studio
Click on Gradle menu.
Expand Gradle Tasks tree
Double click on android -> signingReport and then get the sha1
The problem is that some developers works on the project from
different computers, same project but the sha1 of the apk has changed
and each time I need to get the sha1 from the debug apk and upload it
to firebase console and then download new google-service.json to
android and googleInfo.plist to ios.
without it I get errors with authentication since it not recognize the google-sevice..
How can I solve this issue? what I'm doing wrong?
You can add signing config in build.gradle for debug, like
signingConfigs {
debug {
storeFile file("***.jks")
storePassword "***"
keyAlias "***"
keyPassword "***"
}
}
if multiple developers are working on same project it will work same keystore for everyone.
By default, Android Studio signs all .apk files with default, unprotected debug.keystore that's created for you by Android SDK.
You could either manually create a new keystore that all developers are going to use from now on, or add each developer's debug.keystore signature (SHA-1) as authorized key to Firebase project.
To create a new keystore, use the following command:
keytool -genkey -v -keystore keystore_name.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Then add it to your project, by right-clicking on the module of the app then choosing 'Open Module settings'. On the 'Signing' tab you can see the following:
Add your newly created keystore credentials and path here and you're good to go.
There is tow way:
First Way:
one is you can add SHA key of all the developer key in your firebase console and then share the JSON file.
Second Way:
1. Create Keystore
2. Generate SHA using that keystore. See Here
3. Add Generated SHA in firebase console and download latest json file.
4. Share keystore with another developer.
5. And finally, ask to put following code in your build.gradel file android section like following
buildTypes {
debug {
storeFile file("your keystore path")
storePassword "keysotre-password"
keyAlias "keystore-alias"
keyPassword "keystore-password"
}
}
Related
gives: PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException: 10: , null)
I have a flutter app that has ci/cd & Google sign in which fails because of SHA1 change Because of the change of the machine that builds the apk in debug mode so how to make the google sign in work on the ci/cd apk or How to add the ci/cd machine SHA1 to firebase to. make the google sign in work?
You should create a separate signing key for the debug build type or copy the existing one which was created by your development machine.
Copy the debug signing key into your project folder and configure it in gradle.
Example: Create a signing key namend debug.keystore with the alias androiddebugkey and password android. Then create a folder named keystore in your android project directory and copy the keystore into it. You can assign a debug signing key in the app module's build.gradle file like this:
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('.././keystore/debug.keystore')
storePassword 'android'
}
release {
...
}
}
This way all developers and the CI/CD systems use the same debug signign key.
generate keystore like this answer here
open the keystore with keystore explorer here
copy SHA1 & add it to firebase android app
add the keystore to code magic
I have accidentally deleted .android folder. Then I have removed Android Studio completely from my Mac and then installed newly. Then I tried to create release signed bundle from Build -> Generate Signed Bundle / APK and given all the required details like release keystore file path, alias and password. Then I tired to generate .apk from .aab by using following command,
sudo bundletool build-apks --bundle=<.aab location> --output=<.apk location>
Then I got following message in terminal
INFO: The APKs will be signed with the debug keystore found at '/Users/<myfolder>/.android/debug.keystore'.
From the above message I understood that, keystore files are taken from .android folder. But in my .android folder only debug.keystore file is available, but not release.keystore file.
I assume this is the reason why i am unable to generate release signed bundle. If I am right,
How to have release.keystore file inside .android folder(I have a copy of release.keystore in android/app/release.keystore)?
Note: I am unable to generate release signed bundle since the time I deleted .android folder. Before that everything was just fine.
In build.gradle module app, let add some lines of code below:
signingConfigs {
release {
storeFile file('YOUR_KEYSTORE_FILE')
storePassword YOUR_STORE_PASSWORD
keyAlias YOUR_KEY_ALIAS
keyPassword YOUR_KEY_PASSWORD
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
And then retry the build aab command.
I am beginner in Android. We are facing issues with Google Places API. We generated a SHA key for keystore file and added it to Google console. And use same file for building release apk, and released app. The app is working fine.
With few minor changes we update another version of app, then we got issues with places. Places API is not working.
We need to generate release build from same system, where we generated a SHA key from keystore file? I feel no need because from any system the SHA key is same for release keystore file.
And not added any configurations in Gradle file.
signingConfigs {
release {
storeFile file("my-release-key.jks")
storePassword "password"
keyAlias "my-alias"
keyPassword "password"
}
}
Because we used Sign an APK procedure from this documentation https://developer.android.com/studio/publish/app-signing.html
I am nor getting what exactly we are missing.
I think you are working as a group on project, might be due to code merging. Project got deleted and it will cause problem for you. Just try to configure the place API again. It's the only hope for solving problem.
How do I get my SHA1 Keys for debug and release using android studio on a mac?
(These are required for Google API Keys)
DEBUG:
Click on the Gradle tab on the right hand side of the view.
Go to the ROOT folder -> Tasks -> android -> signingReport
Double click, this will build with the signingReport and post in your bottom view your SHA1.
RELEASE:
In android studio. Build -> Generate Signed APK... and click Next
Copy your key store path and key alias.
Traverse to the "bin" folder of the jdk path present in Java.
Open terminal and enter:
keytool -list -v -keystore "key store path" -alias "key alias"
Enter your key password and this will print out your release SHA1.
UPDATE:
In the new Google Developer console, it can be found at Setup -> App Integrity.
OLD ANSWER:
Here is the new easiest way to find release SHA-1 or other certificates:
I assume that you have already built signed APK and uploaded it to developer console.
Open google play console. Go to "Version Management", go to "Application Signing" and see your certificates.
Note: First google will ask you to activate "Application Signing" for your application.
For Debug Keystore
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For release Keys
keytool -list -v -keystore {keystore_path_with_name} -alias {alias_name}
The entire process of generating certificate fingerprints SHA-1, SHA-256, MD5 for DEBUG as well as RELEASE are divided into the following 3 steps,
Create keystore properties
Load keystore To Gradle
Execute Gradle Task
For genertaing SHA-1 key for release build variant, you have to add
signingConfigs for release in your main module's build.gradle file.
Step 1 ) Add release details in gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "app.devdeeds.com.yourapplication"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
//Signing configurations for build variants "release"
signingConfigs {
release {
storeFile file("F:/Development/myapp.jks")
storePassword "231232das"
keyAlias "myapp_rel"
keyPassword "dasd333_das"
}
}
buildTypes {
//link above defined configuration to "release" build type
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
}
Step 2) open gradle menu from right menu bar and then app > android >
signingReport
Step 3) Click on signingReport and see the magic
As per new Google Play Console UI, the option is available at Setup >> App Integrity
For those who wants to generate release-apk SHA-1, SHA-256 and MD5 through Android Studio, follow these steps:
Goto Project Structure -> Default Config -> Signing Config and then add "RELEASE SHA1" using details provided during Generate-Signed-Apk. For e.g.,
Now set your Signing Config to $signingConfigs.'RELEASE SHA1'
Finally, change your build variant to release mode and run signingReport to generate Keys in release mode.
Hope that, this would definitely generate the release-apk KEYS in easiest way.
Here is simplest way to find SHA1 key Just open the terminal and Type follwing command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
you found SHA1 key Like follow
SHA1: A1:A2:00:00:00:00:00:00:00:AA:00:00:00:00:00:00:00:A8:B2:00
thank you.
How can I deploy and publish an Android app made with React Native to Google Play?
Steps:
Create and then copy a keystore file to android/app
keytool -genkey -v -keystore mykeystore.keystore -alias mykeyalias -keyalg RSA -keysize 2048 -validity 10000
Setup your gradle variables in android/gradle.properties
MYAPP_RELEASE_STORE_FILE=mykeystore.keystore
MYAPP_RELEASE_KEY_ALIAS=mykeyalias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
Add signing config to android/app/build.gradle
defaultConfig { ... }
signingConfigs {
release {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
Generate your release APK cd android && ./gradlew assembleRelease
Upload android/app/build/outputs/apk/app-release.apk to Google Play
Resource: React Native Publishing an Android App
What you want to do is creating a javascript bundle and after that compile the app using gradle. Currently(react-native v0.11) the bundle command only supports generating iOS bundles.
I found a description how to get the android bundle and generate an APK. See https://github.com/facebook/react-native/issues/2712 or https://github.com/facebook/react-native/issues/2743#issuecomment-140697340
Hope this helps.
-- Edit as of 2016 25th of May (v0.26.1 as stable)
Currently it's pretty easy to generate a production APK.
cd android
./gradlew assembleRelease
And now you should have a production APK. You should be able to sign the APK http://facebook.github.io/react-native/docs/signed-apk-android.html#content
React Native is very new in the market, the only guide for android is it's official guide
https://facebook.github.io/react-native/docs/android-setup.html
it'll take time for people to learn & write tutorials for it.
Once you've followed the guide, you can create & run app easily. but there is no mention of publishing in play store officially as of now. wait for some time, they'll tell you soon.
The official documentation has been updated. Look here:
http://facebook.github.io/react-native/docs/signed-apk-android.html#content
As Fackbook hasn't released formal Android deploy method, Try Microsoft Code push to deploy your Android project.
I wrote a tool with some of my colleagues to help setup React Native for deployment. It sets up Fastlane with multiple environments and centralizes the multiple configurations files.
It consists of multiple generators but the ones you will be interested most with are rn-toolbox:fastlane and rn-toolbox:assets (you will need the icons to publish).
We summarised the contents here and you can find the tool on npm
You will still need an Apple Developer account and Android Developer account but this should help you getting to prod quickly.