2017-02-08 81 views
0

我試圖創建我的第一個Android應用程序。爲此,我使用Android Studio 2.2.3。我已經創建了簡單的應用程序與單一的活動,什麼都不做,只是空的屏幕,沒有別的。Android Studio無法安裝應用程序

我正在開發魅族MX6和我接通下一個選項:

  • 安全應用程序 - > USB安裝監視器
  • 設置 - >指紋和securiry - >未知來源
  • 設置 - >輔助功能 - >開發人員選項 - > USB調試

還配置了udev規則。

當我按下運行按鈕我看到這條消息:

Installation failed with message INSTALL_FAILED_USER_RESTRICTED. 
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing. 

WARNING: Uninstalling will remove the application data! 

Do you want to uninstall the existing application? 

而且後,按OK此日誌出現在控制檯輸出:

$ adb push /home/***/dev/android/HelloAndroid/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.android.hello.helloandroid 
$ adb shell pm install -r "/data/local/tmp/com.android.hello.helloandroid" 
pkg: /data/local/tmp/com.android.hello.helloandroid 
Failure [INSTALL_FAILED_USER_RESTRICTED] 


$ adb shell pm uninstall com.android.hello.helloandroid 
DELETE_FAILED_INTERNAL_ERROR 
Error while Installing APK 

有人可以解釋如何解決這一問題?

+0

似乎有人有類似的麻煩:http://stackoverflow.com/questions/40534271/android-studio-failure-install-failed-user-restricted並有一個解決方案。 – vincenth

+0

可能的重複 - http://stackoverflow.com/questions/40534271/android-studio-failure-install-failed-user-restricted – Dibzmania

+0

可能重複的[Android Studio:Failure \ [INSTALL \ _FAILED \ _USER \ _RESTRICTED \] ](http://stackoverflow.com/questions/40534271/android-studio-failure-install-failed-user-restricted) – hustas88

回答

0

檢查當前用戶是否具有root訪問權限。如果您還沒有這樣做,請啓用開發者模式。

0

請清除臨時文件夾並刪除項目中的生成目錄後再次生成。

相關問題