问题描述
我的应用程序不会更新.它可以生成和运行,但是它是一些旧版本,我所做的更改不计算在内.例如,如果我做一个吐司,它不会显示.如果我删除一个现有的,它仍然会显示.
My app won't update. It builds and runs but it's some old version and the changes I've made aren't counted. If I make a Toast for example, it won't show. If I delete an existing one, it will still show.
我已经尝试了以下方法:
I've tried the following already:
-
在SDK管理器中更新Android Studio和更新
Updating Android Studio and updates in the SDK manager
从手机上卸载该应用并重新安装
uninstalling the app off my phone and reinstalling
清洁
确保"Gradle-aware Make"处于运行配置
make sure "Gradle-aware Make" is in run configurations
文件-使缓存无效
确保未选中跳过安装".
make sure "Skip installation" is unticked.
删除项目的构建文件夹并重新构建
delete the build folder of the project and rebuilt
adb shell pm清除com.packagename.app-成功"但未修复
adb shell pm clear com.packagename.app - "Success" but not fixed
adb shell卸载com.packagename.app-成功"但未修复
adb shell uninstall com.packagename.app - "Success" but not fixed
在build.gradle中增加versionCode和versionName
Increase versionCode and versionName in build.gradle
更改构建版本
创建一个新项目并复制文件
Making a new project and copying the files
Android Studio正在设备上安装旧版APK. a>
Android Studio is installing old apk on device
我尝试在另一部手机上执行此操作,并且它也卡在该手机的旧版本上.
I've tried doing it on another phone and it's stuck on an older version on that one too.
推荐答案
这可能会帮助您:
defaultConfig {
applicationId "com.example.app"
minSdkVersion XX
targetSdkVersion XX
versionCode 1 // <-- set this one to a bigger, it is used for upgrade
versionName "1.0"
}
这篇关于Android Studio不会安装新的APK-旧的APK不会在手机上消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!