Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice

Unable to install APK to device

Discussion in 'Android' started by LumoKvin, Dec 9, 2019.

  1. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    In the past, I have built and run many times with no issues. Suddenly today I got this error. I reset my android tablet to factory settings, and I restarted my computer. Still no luck.

    What can I do to fix this?

    Capture.PNG
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,663
    Click on the error, and see the full message below in lower Console window
     
  3. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    First Error:
    Code (CSharp):
    1. CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
    2. C:\Program Files\Unity\Hub\Editor\2019.1.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "5200f46cdc555600" install -r "C:\Users\Home\Desktop\Builds\Math.apk"
    Second Error:
    Code (CSharp):
    1. CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
    2. C:\Program Files\Unity\Hub\Editor\2019.1.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "5200f46cdc555600" install -r "C:\Users\Home\Desktop\Builds\Math.apk"
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    10,317
    Does "adb devices" return "Unauthorized" by chance?
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,663
    That's wrong window, console window is split in two windows, one with messages,the second one with context, it should be below. Click on the error, and check context window.
     
  6. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    I copied and pasted the bottom of the console window.
     
  7. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    I didn't notice any warning about that. Is there a way to check it?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    10,317
    Run adb from the command line to check.
     
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,663
    Also try executing manually
    Code (csharp):
    1.  
    2. C:\Program Files\Unity\Hub\Editor\2019.1.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "5200f46cdc555600" install -r "C:\Users\Home\Desktop\Builds\Math.apk"
    3.  
     
  10. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    I don't have adb on my computer.
    Capture.PNG
    I was able to build and run yesterday by switching the USB port. I don't know why that matters.
     
  11. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,663
    That means, you needed to reauthorize the device, in the end you didn't show what was failing, so it's only a guess
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    10,317
    a
    You need the correct path, it would not be found by default.
     
  13. Liu_Huimin

    Liu_Huimin

    Joined:
    Sep 7, 2019
    Posts:
    1
    I solved this problem. I set the path of adb.exe into the environmental variables, and then delete the original build version in oculus quest, which has already been installed. The reason maybe the difference in oculus link versions, also remember to update your oculus link version.
     
  14. Drewen_Schoon

    Drewen_Schoon

    Joined:
    Mar 4, 2019
    Posts:
    3
    I GOT IT. all I had to do was uninstall the old files that were on my phone (or wherever your building to) and then the build worked
     
    jovindsa likes this.
  15. jovindsa

    jovindsa

    Joined:
    Mar 30, 2021
    Posts:
    1
    Thanks!
    This worked for me. The older files on my phone were built on a previous version of unity and somehow the new unity console wouldn't let me build a new one on the same device. After uninstalling the old app I was able to build my app directly onto my target phone
     
  16. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    308
    If you use debug keystore, that will happen. If you use adb command manually, it should complain about it.
     
unityunity