diff --git a/android/app/build.gradle b/android/app/build.gradle index 75c52d2..879b9df 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -91,12 +91,12 @@ apply from: "../../node_modules/react-native/react.gradle" * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ -def enableSeparateBuildPerCPUArchitecture = false +def enableSeparateBuildPerCPUArchitecture = true /** * Run Proguard to shrink the Java bytecode in release builds. */ -def enableProguardInReleaseBuilds = false +def enableProguardInReleaseBuilds = true /** * The preferred build flavor of JavaScriptCore. @@ -138,6 +138,13 @@ android { compileSdkVersion rootProject.ext.compileSdkVersion + lintOptions { + checkReleaseBuilds false + // Or, if you prefer, you can continue to check for errors in release builds, + // but continue the build even when errors are found: + abortOnError false + } + defaultConfig { applicationId "com.amattang" minSdkVersion rootProject.ext.minSdkVersion @@ -162,6 +169,14 @@ android { keyAlias 'androiddebugkey' keyPassword 'android' } + release { + if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { + storeFile file(MYAPP_RELEASE_STORE_FILE) + storePassword MYAPP_RELEASE_STORE_PASSWORD + keyAlias MYAPP_RELEASE_KEY_ALIAS + keyPassword MYAPP_RELEASE_KEY_PASSWORD + } + } } buildTypes { debug { @@ -175,7 +190,7 @@ android { release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 11b0257..7dab035 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -8,3 +8,5 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: +-keep class com.facebook.hermes.unicode.** { *; } +-keep class com.facebook.jni.** { *; } diff --git a/android/gradle.properties b/android/gradle.properties index 11d6e02..09c427e 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -26,3 +26,7 @@ android.enableJetifier=true # Version of flipper SDK to use with React Native FLIPPER_VERSION=0.99.0 +MYAPP_RELEASE_STORE_FILE=amattang.keystore +MYAPP_RELEASE_KEY_ALIAS=amattang +MYAPP_RELEASE_STORE_PASSWORD=amattang1! +MYAPP_RELEASE_KEY_PASSWORD=amattang1!