Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

APK is suddenly not building...!

Discussion in 'Scripting' started by Reverend-Speed, Jan 19, 2019.

  1. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    284
    So, new Win10 computer, just installed Android SDK (Android Studio), installed the Android USB drivers, hooked up my Samsung 2016 TabA, had it recognised, built my Unity project and...

    Everything worked perfectly! The builds installed and ran on the tablet. My program wasn't working great, but at least it was installing.

    In order to try to solve a graphics error, I used Logcat to read debug.logs with the settings on this page.

    However, upon sending the laptop to sleep and restarting, I can no longer build / install to my tablet. Here are my error messages...

    Installation failed with the following output:
    [ 0%] /data/local/tmp/paintExperiments.apk
    ...
    [ 76%] /data/local/tmp/paintExperiments.apk
    [ 77%] /<message truncated>

    Code (CSharp):
    1. DeploymentOperationFailedException: Installation failed. See the Console for details.
    2. UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.Android.AndroidDeploymentTargetsExtension+LaunchProgressTaskManager taskManager) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    3. UnityEditor.Android.AndroidDeploymentTargetsExtension+<LaunchBuildOnTarget>c__AnonStorey0.<>m__2 () (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    4. UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
    5. UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    6. UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at C:/buildslave/unity/build/Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs:45)
    7. UnityEditor.PostprocessBuildPlayer+<LaunchOnTargets>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:210)
    8. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    9.  
    Code (CSharp):
    1. UnityException: Could not find any valid targets to launch on for Android
    2. UnityEditor.PostprocessBuildPlayer.LaunchOnTargets (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, UnityEditor.Build.Reporting.BuildReport buildReport, System.Collections.Generic.List`1[T] launchTargets) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:242)
    3. UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    4. UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    5. UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:173)
    6. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    7.  
    Code (CSharp):
    1. UnityException: Could not find any valid targets to launch on for Android
    2.  
    I'm at a loss. Can anybody help me get this right again?

    --Rev
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Try reconnecting the device / rebooting;

    Alternatively, remove previous installation of the apk if there's one on the device.
     
  3. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    284
    Thanks xVergilx ! Have reconnected and rebooted the laptop, removed the installation of the apk...

    ...and then I rebooted the tablet and now it works. =/

    Thank you. I should have tried that.

    --Rev
     
  4. Kay_dee007

    Kay_dee007

    Joined:
    May 13, 2018
    Posts:
    4
    Please assist me I have a similar problem yesterday I was able to build then after making some texture change and occlusion calling in a scene with just 4 game objects and also updating my SDK I can't build to my test device anymore I get the errors installation with the following output: performing push install and also UnityException: could not find any valid target to launch on for android please help.
     
    siddharth3322 likes this.
  5. IvanMorones

    IvanMorones

    Joined:
    Jan 23, 2019
    Posts:
    5
    How did you solved it? Have the same problem
     
  6. Kay_dee007

    Kay_dee007

    Joined:
    May 13, 2018
    Posts:
    4
    I uninstalled the SDK completely and reinstalled it cause the update i did earlier was not installed properly
     
    IvanMorones likes this.