英文:
Flutter Android Physical Device App Installation Failing: "App not installed as package appears to be invalid"
问题
I have made an app in Flutter and am trying to install the apk on my physical device.I have done this numerous times in the past but recently I started getting this error when trying to install the apk:
--> "App not installed as package appears to be invalid."
Here are my specs, which hopefully will help:
Phone: Samsung S22+ (Android version 13, last updated Feb 2023)
Apk Installer: Package Installer (default one on the phone)
Method building apk: flutter build apk
or flutter build apk --build-name 1.1.0 --build-number 1
android/app/src/main/build.gradle:
defaultConfig {
applicationId "com.ceventures.app.locationalerts.cedric.eicher"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
Does anyone know how to solve this?
英文:
I have made an app in Flutter and am trying to install the apk on my physical device.I have done this numerous times in the past but recently I started getting this error when trying to install the apk:
--> "App not installed as package appears to be invalid."
Here are my specs, which hopefully will help:
Phone: Samsung S22+ (Android version 13, last updated Feb 2023)
Apk Installer: Package Installer (default one on the phone)
Method building apk: flutter build apk
or flutter build apk --build-name 1.1.0 --build-number 1
android/app/src/main/build.gradle:
defaultConfig {
applicationId "com.ceventures.app.locationalerts.cedric.eicher"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
Does anyone know how to solve this?
答案1
得分: 0
已解决:
对于将来遇到此问题的任何人,以下是最终对我起作用的内容。希望你也有同样的好运,因为这让我疯狂了好几周。
- 在这篇帖子的帮助下(https://stackoverflow.com/questions/54444538/how-do-i-run-test-my-flutter-app-on-a-real-device),我能够像在模拟器上一样直接部署到我的物理设备。为了使其工作,我必须执行:
- 这个(https://stackoverflow.com/questions/70333565/targeting-s-version-31-and-above-requires-that-an-explicit-value-for-android)。
在完成这些步骤后,我能够执行您典型的 flutter build apk
并像以前一样在我的设备上安装它。
希望这对你有帮助!
英文:
SOLVED:
For anyone coming across this in the future, here's what finally worked for me. I hope you have the same luck since this was driving me crazy for weeks.
- With the help of this post (https://stackoverflow.com/questions/54444538/how-do-i-run-test-my-flutter-app-on-a-real-device), I was able to deploy directly to my physical device just like I would my emulator. To make it work, I had to do:
- this (https://stackoverflow.com/questions/70333565/targeting-s-version-31-and-above-requires-that-an-explicit-value-for-android).
Following this, I was able to do your typical flutter build apk
and install it on my device like before.
Hope this helps!!!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论