Reputation: 358
React Native Android app working fine on debug mode but when we are releasing apk it's generating older version of the app.
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 32
targetSdkVersion = 32
googlePlayServicesAuthVersion = "16.0.1"
kotlin_version='1.6.0' //add This change version with your installed kotlin version
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.0.2")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //add This
classpath 'com.google.gms:google-services:4.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
android/grdle/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Upvotes: 3
Views: 733
Reputation: 312
-------------- Apk issues resolve after gradle upgrade -----------------
Step-1:
android/.gradle
folderandroid/build
folderandroid/app/build
folderStep-2:
Then we have to create index.android.bundle
again for that run the below command.
npx 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
Then it will create the following files and folders:
Step-3
android/app/src/main/res/drawable*
foldersThen generate release APK with this command
cd android && gradlew assembleRelease
Upvotes: 4