Search Unity

Unable to install APK to device

Discussion in 'AR/VR (XR) Discussion' started by DaPhamius, Jan 19, 2020.

  1. DaPhamius

    DaPhamius

    Joined:
    Jan 19, 2020
    Posts:
    6
    Hey everybody!

    I'm bumped into problems, but first I'd like to account for how my Unity was set up.
    I installed Unity Hub and from there installed Unity 2019.2.18f1 and added the 2 modules for Android development (Android SDK & NDK Tools + OpenJDK).

    While trying to fix the below mentioned problems, I've uninstalled Unity and installed it again with the 2 modules with no luck.

    I'm having 2 issues.

    1)
    Sometimes it's 50/50 if my device can be found. Usually it's a mix of ctrl+alt+delete and terminate adb.exe to then unplug USB, disable USB debugging, clearing all previous permission from phone, enabling USB debugging and putting back USB cable and refresh in build settings until I see my device (Samsung (...)).
    Did I set something up wrong or is this sadly a step I have to take every time I get into this issue, which is quite often?

    2)
    The other issue is that Unity seems to be unable to install APK to device.
    I get the following issue:

    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.
    E:/Unity/2019.2.18f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\platform-tools\adb.exe -s “ce051715291f08e00d” install -r “E:\Privat\Programming projects\Unity\Augmented Reality Mini Degree\Intro to Augmented Reality\Intro to AR\Builds\ARApp.apk”

    stderr[
    adb: failed to install E:\Privat\Programming projects\Unity\Augmented Reality Mini Degree\Intro to Augmented Reality\Intro to AR\Builds\ARApp.apk:
    ]
    stdout[

    ]
    exit code: 1

    Hope some bright head can help me :<

    Sincerely
    Dan Pham
     
  2. DaPhamius

    DaPhamius

    Joined:
    Jan 19, 2020
    Posts:
    6
    Update: Seems to be a big issue with my devices going offline and online all the time.

    After several times writing adb devices in Command Prompt, It's 50/50 if I see it offline or online.

    I tried installing the apk file via Command prompt with the following:

    E:/Unity/2019.2.18f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\platform-tools\adb.exe -s "ce051715291f08e00d" install -r "E:\Privat\Programming projects\Unity\Augmented Reality Mini Degree\Intro to Augmented Reality\Intro to AR\Test.apk"

    and got a "Failed to install" notice.
     
  3. DaPhamius

    DaPhamius

    Joined:
    Jan 19, 2020
    Posts:
    6
    Update: Resolved!


    Resolved. I had a faulty USB Cable.
    I tried another and it worked.
     
    hybrid_dragon and Whitepot like this.
  4. martinob

    martinob

    Joined:
    Aug 14, 2014
    Posts:
    1
    thnx that solved my problem