Flutter apk package appears to be invalid
Asked Answered
R

4

6

I have been trying to build an apk using the command "flutter build apk" and the apk is building perfectly fine and I am also able to run the same on my emulator. But for some weird reason when testing on a physical device I get the following error stating that "App not installed. Package appears to be invalid.". Any sort of help regarding this issue will be highly appreciated. Thanks in advance.

enter image description here

Rifle answered 15/5, 2023 at 5:40 Comment(4)
Uninstall your old app and try againBalkanize
Unfortunately, I was never able to install the apk. So, there is nothing that I am able to uninstall to re-install.Rifle
On the phone activate Developer Options and Android Debug bridge (adb), connect your phone to a PC with MinimalADb or Android SDK installed and install the app using the command adb install <apkfilename>. Then you will get an error message why install fails..Absorber
Upon reviewing my build.gradle file, the compileSdkVersion is assigned to 33 and the targetSdkVersion is assigned as 32. Does this impact the installation of the apk in any way?Rifle
C
4

100% I have faced the same problem

Check or Configure agin your android/app/build.gradle

  1. Go to => https://docs.flutter.dev/deployment/android

  2. Find the Configure signing in gradle:

  3. follow the step agin:

Or Go to your project location:

[project]/android/app/build.gradle

  1. Find the defaultConfig section
  2. Paste this code below

 signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
       }
   }
  
Cabal answered 7/12, 2023 at 16:39 Comment(0)
B
0

This may be due to conflicts with packages already installed on your device. This can happen when trying to install an app with the same package name as an already installed app. Please remove the problematic app and reinstall the desired app using the new APK file to fix the issue

Bender answered 15/7 at 11:8 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewGoldner
D
0

if you just need to install the app on mobile device for testing purposes, Then create APK file using debug option flutter build apk --debug, this will resolve the signing issue which required for prod/release version.

You can trace the log by installing the app from your shell on your PC to get the reason for this error (may its not related to signing issue):

make sure you are in flutter-apk folder and run this command on shell:

For Debug version:

 $ adb install app-debug.apk

For release/Prod:

$ adb install app-release.apk
Dimerous answered 28/10 at 11:37 Comment(0)
G
-1

Try to do the following steps :

  1. flutter clean 2.flutter pub get
  2. flutter run

after flutter run, tried to install app-debug.apk, hopefully it will work for you

Goa answered 9/8, 2023 at 1:42 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Metry
This doesn't work.Gorden

© 2022 - 2024 — McMap. All rights reserved.