i had a problem while debugging usb with my phone in vscode

27 Views Asked by At
PS D:\first_app\flutter_application_1> flutter run
Launching lib\main.dart on M2102J20SG in debug mode...
Running Gradle task 'assembleDebug'...                              9.8s
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app-debug.apk...           8.1s
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install D:\first_app\flutter_application_1\build\app\outputs\flutter-apk\app-debug.apk: Failure
[INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
Error launching application on M2102J20SG.

i just dont know please tell me how to fix it.

2

There are 2 best solutions below

0
Dana Raja On
  1. Turn off "MIUI optimization" and Restart

    Turn On "USB Debugging"

    Turn On "Install via USB"

0
WizardKing On

When you debugging app for 1st time Phone will ask your permission to install app, so keep an eye on it.

When prompted allow it install an app.

You only have to do it once, but it will ask again when you uninstall an app from phone.