简体   繁体   中英

How to fix “Error while install APK” error in android studio

I am trying to get setup to do some android development and I am trying to get a test segment of code to run on a virtual device. I have tried with a virtual pixel and a pixel 2 xl connected via USB, both with USB debugging enabled. The error says the adb server is not set but I don't know what that means or how to fix it.

I tried running adb kill-server and that seemed to work at first but studio still returns the following error and doesn't send the app to the virtual device, even though it is running on my desktop. (I am running Linux Mint 19.1)

03/26 13:38:55: Launching app
$ adb push /home/nick/Documents/Workspaces/Android/FirstApplication/app/build/outputs/apk/debug/app-debug.apk /data/local/tmp/com.example.firstapplication
com.android.ddmlib.AdbCommandRejectedException: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Error while Installing APK
  1. Disable Instant Run.

    Open the File option. Select Settings. Choose Build, Execution, Deployment. Select Instant Run. Uncheck the “Enable Instant Run to hot swap code/resource changes on deploy box.

  2. Check Usb Debugging Settings.

  3. Grant Access to Install APK on the device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM