React原生Android应用程序在调试模式下运行良好,但当我们发布APK时,它会生成旧版本的应用程序。
安卓系统/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
1条答案
按热度按时间q3qa4bjr1#
----------------在Gradle升级后解决APK问题------------------
第一步:
android/.gradle
文件夹android/build
文件夹android/app/build
文件夹第二步:
然后,我们必须再次创建
index.android.bundle
,运行以下命令。然后它将创建以下文件和文件夹:
第三步
android/app/src/main/res/drawable*
文件夹然后使用以下命令生成发布版APK
cd android && gradlew assembleRelease