Unable to install APK to device!

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…

Does unity have your SDK path?

UnityMainMenu / Edit / Preferences… / ExternalTools / Android

1 Like

Yup, double checked and am now re-installing Android studio

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 :frowning:

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.

1 Like

Will give that a go thanks!

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! :smile:

-EDIT-

fixed it! just a network problem…

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)

Having the same issue, any feedback on how to fix this would be greatly appreciated.

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: Setup Android Environment Variables - AutomationTestingHub

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.

1 Like

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.

For me it help uninstalling the app from the phone and building it again.

11 Likes

Same: Uninstall & Build (+Deploy) worked

8 Likes

This worked for me also, only had this issue when working between different computers and overwriting the build on an Oculus Quest

4 Likes

I thought that uninstalling the app would just mess it up more, but that was the real fix

1 Like

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.

1 Like

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”

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.

4 Likes

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.

1 Like

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.