Deploy/Publish Android app made with React Native - android

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.

Related

I have a flutter app that has ci cd(code magic) & Google signin which fails because of SHA1 change?

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

android signing with platform keys versus uploadkeys

I am developing for a closed platform and need to sign my apk with platform keys to be able to read from certain protected libraries. since this app additionally is not available on the Google Play store, does this mean that I don't need to sign with any other public private key pair for a release build? currently my workflow is such that we first create the build with gradlew assembleRelease which I assume uses the local.properties to sign my apk given the current build.gradle setup:
release {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('./debug.keystore')
storePassword 'android'
}
if I am subsequently using apksigner to sign with the platform credentials, does that render the aforementioned release build.gradle config pointless?
So it looks like the gradle configuration is used for a particular build type, or the alternative is to use zipalign and apksigner on the apk generated from the gradle task. So if i wanted to continue using apksigner i should remove the build.gradle configuration. I guess theoretically it was signing again the app twice, but since the last one was the non-debug keys, it didn't really matter.
For reference:
https://developer.android.com/studio/build/building-cmdline#gradle_signing

firebase sha1 changed in same project

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"
}
}

Android Google Places API issue with key

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.

Bamboo + Android + Gradle : how to produce signed apk?

Newbie with Bamboo trying to produce .apk for android application.
I have done the checkout and gradlew build tasks for default job, so the download and build process is fine.
What I need is to be able to produce signed .apk file and deliver it in someway to other part of our team.
Thinking about modify the gradle script to produce signed .apk with keystore/password and so, but not sure how to configure Bamboo to serve the .apk.
Any help much appreciated.
Building a signed APK is a function of your Gradle build script and not Bamboo. Based on the information available here, this is how I build a signed APK using Gradle. The information under the "Signing Your App in Android Studio" section is particularly helpful to create the keystore and the key necessary to sign the APK.
// APK signing configuration
android.signingConfigs {
MobileApp {
storeFile file("${rootDir}/TempKeyStore.jks")
storePassword "********"
keyAlias "********"
keyPassword "********"
}
}
// Build types - debug and release both use signing config above to
// sign the resultant APKs
android.buildTypes {
debug {
signingConfig android.signingConfigs.MobileApp
}
release {
signingConfig android.signingConfigs.MobileApp
}
}
Once you have your Gradle build script configured to build a signed APK, Bamboo can be easily configured to run your Gradle build script.

Categories

Resources