Skip to content

Instantly share code, notes, and snippets.

@koobitor
Last active February 2, 2020 13:29
Show Gist options
  • Select an option

  • Save koobitor/4c48788d187b5dfd111e69486ed87b02 to your computer and use it in GitHub Desktop.

Select an option

Save koobitor/4c48788d187b5dfd111e69486ed87b02 to your computer and use it in GitHub Desktop.

KeyStore

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

Android Fix Build

## native_modules.gradle
def command = "yarn --silent react-native config"

[Ref]

Android Debug

### android/app/build.gradle
android {
....
  signingConfigs {
    release {
      storeFile file('your_key_name.keystore')
      storePassword 'your_key_store_password'
      keyAlias 'your_key_alias'
      keyPassword 'your_key_file_alias_password'
    }
  }
  buildTypes {
    release {
      ....
      signingConfig signingConfigs.release
    }
  }
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

APK

cd android
./gradlew assembleRelease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment