Can we generate the new debug key in ~/.android folder? I already deleted the old debug.keystore from android folder and created the new one. Also, I am confused that everywhere is written to get the debug key
keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
~/.android folder is specified.
So, my question is can we generate the new key in project (android/app/debug.keystore) in react native. If we need to generate the new debug key what are the cons and prons.
In React Native when I'm trying to get Google GPS API key in Google console, I have seen package name and SHA-1 key where to I get SHA-1 key in React Native
How to get SHA-1 key in React Native cli? (not in Expo).
Windows:
– Open a terminal window
– Change the directory to the JDK bin directory. The path of the JDK depends upon the operating system you are using
cd C:\Program Files\Java\jdk1.8.0_121\bin
– Now we have to run the following command using the keytool.exe file in JDK/bin
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Ubuntu/Mac
– Open a terminal window
– Now run the following command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For more details click Here
From React-native Project:
– Run this command in React-Native App directory
cd android && ./gradlew signingReport
– copy the SHA1 from the debug key (This generates two variant keys. You can copy the 'SHA1' that belongs to the debugAndroidTest variant key option.)
There is debug.keystore available by default in android => app folder so we can use it to generate SHA1 key.
The command is as follows
keytool -exportcert -keystore ./android/app/debug.keystore -list -v
It will ask for password so just press Enter.
As far as I understand you, it's about Android.
You need input certificate fingerprint, what you use for sign *.apk file.
For generate SHA-1 fingerprint, open a terminal window and enter the following:
keytool -list -v -keystore PATH_TO_YOUR_KEYSTORE.keystore -alias YOUR_ALIAS_NAME -storepass YOUR_STORE_PASS -keypass YOUR_KEY_PASS
This should look something like this:
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75
You can find more information here
If you don't have a certificate yet, I recommend you create it.
How to create a certificate you can read here.
Get SHA1 Key
Simple run below command :
keytool -list -v -keystore ./android/App/debug.keystore -alias androiddebugkey -storepass android -keypass android
if your are Using react native
and using
keytool -list -v -keystore ./android/App/debug.keystore -alias androiddebugkey -storepass android -keypass android
there are Chances getting ERROR
to Avoid ERROR in WINDOWS
1)Run your Command Prompt As Administrator
Navigate to your react-native project's root folder
3)cd android
4)type in ./gradlew signingReport
this will generate All kinds of SHA-1 And SHA-256 and many more details
Even though running keytool on jdk/bin and ./gradlew signingReport command gives SHA-1 & SHA-256 keys I had troubles when using those keys on firebase / gcp to register my app. For some reason running keytool command on project root folder output gives you a SHA-1 key which can be use to register the app in gcp. In windows, there are the steps you should follow
Make sure keytool is the enviroment variable path
Open the cmd in your root project folder (eg: C:/myreactnativeproject/)
run keytool -list -v -keystore ./android/app/debug.keystore -alias androiddebugkey -storepass android -keypass android
And there is your SHA-1
my solution: keytool -J-Duser.language=en -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
first move to android folder cd android
and than simply run .\gradlew signingReport command
this help me on windows operating system
First Go To Your Project Directory And Just Simple Run This Command
keytool -list -v -keystore ./android/App/debug.keystore -alias androiddebugkey -storepass android -keypass android
And You Can Get
I'm attempting to generate a signed APK for my react-native project. I've received the error message error: "uncompiled PNG file passed as argument. Must be compiled first into .flat file.."
How do I resolve this issue? I've looked at this question and have also tried adding android.enableAapt2=false to the gradle-wrapper.properties file.
I have also tried manually creating a debug build as instructed here:
Finally, I noticed that there's a key component missing in the rn documentation
The first step is to
keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
However, I did not see anywhere about specifying the location for the my-release-key.keystore file. I was not able to get this to work until I used
keytool -genkey -v -keystore d:\my_private_key.keystore -alias my_key_alias -keyalg RSA -keysize 2048 -validity 10000
android.enableAapt2=false
should be placed inside gradle.properties NOT gradle-wrapper.properties!
I cant install apk from react-native
Its tel me " "App not installed""
I build it use ing
./gradlew assembleRelease
BUILD SUCCESSFUL
Total time: 15.842 secs
This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html
I STFW
and I find
this
https://github.com/facebook/react-native/issues/4421
and this
Unable to install signed apk from React Native
but Didn't solve the problem
The documentation in the link that you've shared:
I use this to sine my apk
facebook.github.io/react-native/docs/signed-apk-android.html and I try
unsine apk but its the same
Is not complete and does not sign your APK file.
As seen here:
Android requires that all apps be digitally signed with a certificate
before they can be installed, so to distribute your Android
application via Google Play store, you'll need to generate a signed
release APK. The Signing Your Applications page on Android Developers
documentation describes the topic in detail. This guide covers the
process in brief, as well as lists the steps required to packaging the
JavaScript bundle.
gradlew assembleRelease will only build/bundle your application for production. You need to sign the APK file yourself.
These are the steps which I take when I want to run my application in production mode:
keytool -genkey -v -keystore key.keystore -alias app-alias -keyalg RSA -keysize 2048 -validity 10000
cd android && gradlew assembleRelease && cd ..
jarsigner -verbose -keystore \path_to_key\key.keystore \path_to_apk\app-release-unsigned.apk app-alias
zipalign -f -v 4 \path_to_apk\app-release-unsigned.apk appName.apk
Follow these steps and your app should be installed successfully.
Prerequisite - You must have a keystore file, If you don't have then Open cmd run keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 follow instructions and you are done.You will have a keystore file. Now follow these steps.
1 .On windows cd android and then run gradlew assembleRelease
2 .Find APK at this location android/app/build/outputs/apk/release/app-release-unsigned.apk
3 .Copy this APK to bin folder of jdk installation directory ( for me directory was C:\Program Files\Java\jdk1.8.0_181\bin ) [ Basically in this step we are trying to go to the same directory as jarsigner]
4 .Also Copy your keystore file to this ( C:\Program Files\Java\jdk1.8.0_181\bin ) directory.
5 .Now Open cmd in Administrator mode and run cd C:\Program Files\Java\jdk1.8.0_181\bin
6 .Now run
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore
<<your keystore file name >> <<your apk file name>> alias_name
Here goes your apk , now find your signed apk here C:\Program Files\Java\jdk1.8.0_181\bin . Run it, Now it should install.
I made a map app for Android. But when I try to get the MD5 for Map API kety,using the command keytool.exe
-list -alias androiddebugkey
-keystore "C:\android\debug.keystore"
-storepass android -keypass android
I get only one sha1 and not the MD5. I am using jdk 7 and Windows 7 32 bit. Any help is much appreciated. Thanks.
With JDK 1.7 installed, keytool outputs by default SHA1 fingerprint, not MD5. Adding -v option allows to see MD5 as well.
-v for verbose..