Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  4. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Unable to install APK to device!

Discussion in 'AR/VR (XR) Discussion' started by FingerInd, Apr 12, 2017.

  1. FingerInd

    FingerInd

    Joined:
    Apr 5, 2016
    Posts:
    38
    Updated to the new version of Unity 5.6..

    now getting this error when I try to build:

    CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor.

    anyone else getting this problem?

    Thinking I may have to re-install the android sdk as a first step...
     
  2. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Does unity have your SDK path?

    UnityMainMenu / Edit / Preferences... / ExternalTools / Android
     
    FingerInd likes this.
  3. FingerInd

    FingerInd

    Joined:
    Apr 5, 2016
    Posts:
    38
    Yup, double checked and am now re-installing Android studio
     
  4. FingerInd

    FingerInd

    Joined:
    Apr 5, 2016
    Posts:
    38
    ha! even worse now:

    CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    C:\Program Files\Java\jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/arthur.tubb/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "E:\ProgramFiles\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    C:\Program Files\Java\jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/arthur.tubb/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "E:\ProgramFiles\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -


    looks like I'm spending my afternoon fixing this :(
     
  5. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    383
    Looks like your java jdk might cause an issue. Try updating that as well, or maybe your better off uninstalling android sdk and java jdk and both fresh install them. Make sure you install java jdk before android sdk. I had issues that way, I can confirm that exporting to Android works, have tested it myself for GoogleVR and GearVR, however GearVR has Vulkan API issues.
     
    FingerInd likes this.
  6. FingerInd

    FingerInd

    Joined:
    Apr 5, 2016
    Posts:
    38
    Will give that a go thanks!
     
  7. FingerInd

    FingerInd

    Joined:
    Apr 5, 2016
    Posts:
    38
    Got unity working again after downgrading to 5.5 and reinstalling android sdk and Java jdk...
    I can build fine to the gear Vr but now I don't get a .apk file and I get this error:

    DirectoryNotFoundException: Could not find a part of the path

    Love these weird problems! :D

    -EDIT-

    fixed it! just a network problem..
     
    Last edited: Apr 21, 2017
  8. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,159
    Bump, any news on that?

    I'm on unity 5.6.1f1
    Jdk 1.8 151
    Android Studio 3.0.1 (downgraded the tools folder to r25.2.3)
    Installed the plugins on Android Studio for the version I'm building to (4.44)
    Added the paths to it on the environment variables (JAVA_HOME, JDK_HOME and Path variable with the path to the android sdk folder)
    Setup the path on Unity - Preferences - External Tools - SDK/JDK.

    Still didn't work, it fails right before it finishes (Copying APK to device)
     
  9. beyonderic

    beyonderic

    Joined:
    Dec 23, 2016
    Posts:
    2
    Having the same issue, any feedback on how to fix this would be greatly appreciated.
     
  10. Kyodan

    Kyodan

    Joined:
    Feb 5, 2015
    Posts:
    8
    This error means that ADB and the associated tools haven't been specified in your Windows Environment Variables. Here is a good guide on how to properly set your EVs: http://www.automationtestinghub.com/setup-android-environment-variables/

    The error mentioned here is specifically related to the Android\Sdk\platform-tools folder, though it is best to add all of the paths mentioned in the guide linked above.
     
    umerremu likes this.
  11. Jovaan

    Jovaan

    Joined:
    Aug 1, 2014
    Posts:
    12
    For me, LG top phone from 2015 did not ever accept upload from USB 3 port (not hub, port directly on motherboard). All drivers were OK and device was recognized, but upload the binary always failed with "peer reset connection" etc.

    Simply swtching the plug to USB 2 port repaired the issue. It is worth trying all USB ports on the machine before suspecting drivers, sdk or jdk etc.
     
  12. orgelvarg

    orgelvarg

    Joined:
    May 27, 2019
    Posts:
    15
    For me it help uninstalling the app from the phone and building it again.
     
    ingridsl, Novack, richmerren and 6 others like this.
  13. PEZO19

    PEZO19

    Joined:
    Oct 24, 2013
    Posts:
    23
    Same: Uninstall & Build (+Deploy) worked
     
  14. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,037
    This worked for me also, only had this issue when working between different computers and overwriting the build on an Oculus Quest
     
  15. AntGenix

    AntGenix

    Joined:
    Oct 30, 2019
    Posts:
    2
    I thought that uninstalling the app would just mess it up more, but that was the real fix
     
  16. PEZO19

    PEZO19

    Joined:
    Oct 24, 2013
    Posts:
    23
    Also guys, don't forget to uninstall the app from every User account on your android device if you have multiple at the same time.
     
  17. jaweherncir

    jaweherncir

    Joined:
    Apr 29, 2020
    Posts:
    5
    I need a help
    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.
    C:\Users\LENOVO\AppData\Local\Android\sdk\platform-tools\adb.exe -s "AGY7N19312001479" install -r -d "C:\Users\LENOVO\Documents\Ather MethodeGmail\bnnb.apk"
     
  18. Lu_Atar

    Lu_Atar

    Joined:
    May 16, 2017
    Posts:
    5
    I had this issue a moment ago when I tried to Build & Run on my Android phone. I have Android SDK and all other SDKs up to date. Eventually, the problem was in my phone Xiaomi. I had to go to Settings -> Developer Options, check "Install via USB", and uncheck "Verify apps over USB", then it worked. Maybe one of these settings is optional.
     
  19. marcusferron

    marcusferron

    Joined:
    Oct 22, 2018
    Posts:
    2
    I solved this problem by freeing up more space on my Android phone. You must have about 10x the size of the game in free space in the cell.
     
  20. marcusferron

    marcusferron

    Joined:
    Oct 22, 2018
    Posts:
    2
    I solved this problem by freeing up more space on my Android phone. You must have about 10x the size of the game in free space in the cell.
     
  21. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    340
    I can't see the "Install via USB" setting anywhere.

    God , why is this always such a pain,
    I've installed another unity build recently on my phone, why is it not working now?
     
  22. ConicalM

    ConicalM

    Joined:
    Oct 17, 2016
    Posts:
    2
    If you did manage to do a build at some point before on that device crazy enough.. tried everything only thing that worked was deleting the installed app from the device entirely and trying again... random
     
  23. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    340
    I build something else on it, this app was never installed on it.
     
  24. Masteraider73

    Masteraider73

    Joined:
    Aug 5, 2018
    Posts:
    2
    If anyone is still struggling this far into the thread, here is the quick solution. no need to do any of that environment stuff.

    FREE UP SOME SPACE ON UR DEVICE!

    it worked instantly for me after 3 days of trying to fix it.
     
  25. kaplahoma

    kaplahoma

    Joined:
    Dec 19, 2019
    Posts:
    1
    Also try delete spaces from your path to project. It's work for me.
     
unityunity