adb: failed to open app.apk: Operation not permitted

Viewed 854

I am unable to run the app on a physical device (Xiaomi) after upgrading the flutter SDK to the latest version. It is working fine on downgrading the flutter and few packages.

OS: Ubuntu 18.04.5 LTS

The error details are in the below image. I have also tried to install the apk via the command line which is also not working

$ adb install app.apk
adb: failed to open app.apk: Operation not permitted

Tried adb kill-server, gave full permission to the folder, etc. Nothing worked.

I am able to debug the sample flutter app on my physical device/genymotion emulator. it will start throwing the above error if I add the packages like cloud_firestore, amplify, flutetrtoast, etc.

One more thing I have noticed is I can debug up to a particular version of the package. for example, It is working fine for the package fluttertoast till the version 6.0.1.

More logs are available in this GitHub issue

Please help.

The error details are in the below image

4 Answers

Looks like a permission error to me. Run flutter clean and then open your editor as an administrator.

The issue is in your phone settings, you need to enable in your Developer options "Install via USB".

Although my gut is telling me that it is Android (especially if it is version 10), I have to go with my eyes here. That message is from a firewall that was tripped on the PC end. It says as much.

That said just to be sure, also make sure that you have enabled the option for "accept files from unknown sources" in the device settings as well (either in security or developer options). It could just be a really poorly worded alert.

Looks like some package has an issue with Redmi Note 7S. For example: fluttertoast => make sure you use the compatible version

Related