How can I deploy and publish an Android app made with React Native to Google Play?
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 PlayWhat 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With