如何解决gradlew assembleRelease 生成两个版本的APK新旧版本
我通过 gradlew assembleRelease
生成 APK 文件,并通过 adb install app-release.apk
运行此 APK。问题是,当我第一次运行该应用程序时,一切正常,但如果我关闭该应用程序(android 任务按钮 > 关闭所有)并重新运行该应用程序,我将得到我的应用程序的非常旧版本(两个月前生成)。
我尝试过的:
cd android && ./graldew clean // before generating the APK
我也遵循以下步骤:
1.Delete (index.android.bundle) files inside directory android/app/src/main/assets.
2.run 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
3.Delete folders (drawable,drawable-hdpi,drawable-mdpi,drawable-xhdpi,drawable-xxhdpi,drawable-xxxhdpi,raw) inside android/app/src/main/res
4. ./gradlew clean > ./gradlew assembleReleae
但它不起作用。这是更多信息:
//package.json
{
"name": "ktIP",//...
},"rnpm": {
"assets": [
"./assets/fonts"
]
},"dependencies": {
"react": "16.8.3","react-native": "0.59.1",},"devDependencies": {
"@babel/core": "^7.3.4","@babel/runtime": "^7.3.4","@types/jest": "^26.0.0","@types/react": "^16.9.38","@types/react-native": "^0.62.13",}
//build.gradlew
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 30
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
我可以编辑我的问题以获取更多信息。
同样的问题,如果我运行 react-native run-android --variant=release
但我在调试版本中运行良好,react-native run-android
不知道是不是React Native(59)旧版本的原因,要不要升级到63
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。