0

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?

  • have you tried flutter clean, flutter doctor, and flutter pub get again. – rvng May 22 '23 at 06:21
  • Hi rvng, yes I have... Everything comes out with green checkmarks. No issues it picks up (I'm on the flutter stable channel, 3.7.9) – usafutb0l3r May 22 '23 at 07:52

1 Answers1

0

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.

  1. With the help of this post (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:
  2. this (Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]).

Following this, I was able to do your typical flutter build apk and install it on my device like before.

Hope this helps!!!