The application could not be installed: INSTALL_FAILED_USER_RESTRICTED

Android studio gives the following error after clicking “run app”

Installation did not succeed.
The application could not be installed: INSTALL_FAILED_USER_RESTRICTED

List of apks:
[0] 'E:\MyProject\xxx\app\build\outputs\apk\debug\xxxxx_.apk'
Installation via USB is disabled.

Troubleshooting steps:

1. It may be that the USB installation is not enabled in the developer option. Check whether it is enabled and try again

2. It is possible that the application tag of androidmanifest.xml has been added

android:appComponentFactory=""
tools:replace="android:appComponentFactory"

Delete this attribute and try again.

Read More: