1

So I am currently using:

  • JDK 10
  • Android SDK
  • Unity 2017 Version 2017.4.0f1
  • Unity Remote 5
  • Samsung Galaxy s8 Version 8.0

I was following a quick tutorial on getting started on Unity but while in the tutorial it says I should be able to build & run on my connected android device, it is not working on mine.

Things that I have tried:

  1. Built the APK file and manually installed the APK on my Android Phone. Result: after tapping on "Install" I got a message saying "App not installed".
  2. Tried installing several versions (including the latest one) of the Android SDK.
  3. Followed several set-up tutorials - all different in the sense where in some, they copied and pasted files from certain folders to the root folder.
  4. Changed Player settings Install Location to "Automatic".
  5. Created Keystore (Key alias included).

When I try to "Build & Run", I get the following error on my console window:

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/Eric/AppData/Local/Android/Sdk\platform-tools\adb.exe -s "ce041714314828370d" install -r "C:\Projects\Unity\Test1\Android Test\test1.apk"

stderr[
adb: failed to install C:\Projects\Unity\Test1\Android Test\test1.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl936559745.tmp/base.apk: Attempt to get length of null array]
]
stdout[

]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidDevice.Exec (System.String[] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidDevice.Install (System.String apkfile, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit)
UnityEditor.Android.AndroidDeploymentTargetsExtension+<UploadAPK>c__AnonStorey2.<>m__0 ()
UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.BuildReporting.BuildReport buildReport, UnityEditor.Android.AndroidDevice device, UnityEditor.ProgressTaskManager taskManager)
UnityEditor.Android.AndroidDeploymentTargetsExtension+<LaunchBuildOnTarget>c__AnonStorey1.<>m__0 ()
UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.BuildReporting.BuildReport buildReport, DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler)
UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (BuildTargetGroup targetGroup, UnityEditor.BuildReporting.BuildReport buildReport, DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at C:/buildslave/unity/build/Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs:36)
UnityEditor.PostprocessBuildPlayer+<Launch>c__AnonStorey0.<>m__1 () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:181)
UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
UnityEditor.PostprocessBuildPlayer.Launch (BuildTargetGroup targetGroup, BuildTarget buildTarget, System.String path, System.String productName, BuildOptions options, UnityEditor.BuildReporting.BuildReport buildReport) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:197)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

I have been on this for over 6 hours now, can anyone tell me what I am doing wrong?

Eric Ahn
  • 155
  • 1
  • 2
  • 11
  • Try what's in the duplicate. If still not working, let me know. Also try with an empty scene just to make sure that nothing else in your current project is causing that issue/ – Programmer Apr 08 '18 at 09:58
  • @Programmer I have already tried using the SDK version mentioned in the post you referred me to. Whenever I try updating the SDK it gives me this message: "Unable to update the SDK. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. See the console for details. This is the error I get: https://www.photobox.co.uk/my/photo?album_id=5300206311&photo_id=500707194911 – Eric Ahn Apr 08 '18 at 11:15
  • Try the solution from my answer that says "LATEST SOLUTION" not the old part that says "OLD SOLUTION". By the way, no one can access the image you posted above. It says we don't have permission to. – Programmer Apr 08 '18 at 11:30
  • @Programmer yes, that is what i meant..on the "LATEST SOLUTION" it says to download the file on the link and add the path of the new unzipped file - which i did. i uploaded the photo again on another website: https://imgur.com/a/n5zk0 – Eric Ahn Apr 08 '18 at 12:40
  • 1
    Close Unity. Download Android Studio, Go to Tools-->Android-->SDK Manager. Select Android SDK from the left panel. On the right, you will see **Android SDK Location"**, click Edit then point it to that place you downloaded the SDK from my other answer. From this SDK Manager Window, you can update the SDK Platform s and SDK Tools and then try to build form Unity again. See circle places in [this](https://i.imgur.com/s0M5iP7.png) image for more information – Programmer Apr 08 '18 at 13:55
  • 1
    @Programmer It worked! I cannot express how grateful I am for your help. Thanks a lot. – Eric Ahn Apr 08 '18 at 14:43
  • You are welcome. When I have time I will edit this into my other answer just for the people that will also encounter this too. – Programmer Apr 08 '18 at 14:44
  • @Programmer good idea, i have seen many people with similar issues – Eric Ahn Apr 08 '18 at 15:27

0 Answers0