skip to Main Content

i copied the code from https://github.com/felangel/bloc/tree/master/examples/flutter_todosapplication runs perfectly on the web and on the android emulator. BUT does not launch via APK on a physical device. Gives the error: "app not installed as package appears to be invalid". How to fix?

Tried to run on Android 8 and 12

2

Answers


  1. Try to connect and debug by your device, or if you build and install apk on your device, what command did you used for building apk file?

    In case you are using flutter build apk --split-per-abi to build apk file, make sure to verify your device architecture and install file suit for your device.

    Try to follow this flutter document, maybe it help you to solve your issue.

    Login or Signup to reply.
  2. Step1: Ensure that the physical device is properly prepared and setup with Android USB debugging enabled.
    Incase USB ddebugging isn’t enabled, here’s how you do it. Go to your device settings -> About phone -> Build number -> tap it 10 times -> insert your pin / password -> Viola. Developer options are enabled -> Go to developer options -> Switch USB Debugging on

    Step2: When you plug in the physical device, ensure that it is visible among the connected devices list (bottom right in VS code, top center or top right in Android Studio)

    Step 3: Ensure you have enough free space on your device

    Step 4: Uninstall all previous versions of the app from the device before running the app

    Step 5: If you have the phone plugged in and detected, in the terminal, run flutter run --release

    Step 6: IF you prefer to use APK, type flutter build apk --release This will create a FAT APK file which can run on any android device.

    Step 7: If all the above fail, then try changing phone. Maybe your phone is cursed

    Step 8: IF all fails, then run flutter build appbundle , upload the arb file to your playstore internal testing and use the app as an internal tester

    Step 9: If all those fail still, then come back here and notify me.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search