Reputation: 221
How can I deploy and publish an Android app made with React Native to Google Play?
Upvotes: 22
Views: 11650
Reputation: 1662
android/app
keytool -genkey -v -keystore mykeystore.keystore -alias mykeyalias -keyalg RSA -keysize 2048 -validity 10000
android/gradle.properties
MYAPP_RELEASE_STORE_FILE=mykeystore.keystore
MYAPP_RELEASE_KEY_ALIAS=mykeyalias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
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
}
}
cd android && ./gradlew assembleRelease
android/app/build/outputs/apk/app-release.apk
to Google PlayUpvotes: 18
Reputation: 38
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.
Upvotes: 0
Reputation: 639
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
Upvotes: 4
Reputation: 10955
As Fackbook hasn't released formal Android deploy method, Try Microsoft Code push to deploy your Android project.
Upvotes: 1
Reputation: 1815
The official documentation has been updated. Look here: http://facebook.github.io/react-native/docs/signed-apk-android.html#content
Upvotes: 2
Reputation: 798
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.
Upvotes: 2