Search Unity

Unity Failed to build APK

Discussion in 'Editor & General Support' started by unity_ybf9DJzDxZsQRw, Nov 19, 2017.

  1. unity_ybf9DJzDxZsQRw

    unity_ybf9DJzDxZsQRw

    Joined:
    Nov 19, 2017
    Posts:
    2
    Im working on game develop in Unity, and now i want to make a game of Android. i downloaded the jdk,spk, etc.. i followed exacly how the videos told me but when i connect my Android to the game and click on "Build And Run" i get the error in the end of the process : Failed to build APK!.

    what console shows : OperationFailedException: Installation failed. See the Console for details. UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.BuildReporting.BuildReport buildReport, UnityEditor.Android.AndroidDevice device, UnityEditor.ProgressTaskManager taskManager) UnityEditor.Android.AndroidDeploymentTargetsExtension+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+c__AnonStorey0.<>m__1 () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:181) UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Please help me :/ and tell me if i need to give additional info, ty.
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Is your device connected to computer, has development mode enabled and trust has been established?
     
  3. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    165
    Hi Aurimas, I'm not the original poster, but am seeing the same problem with an extremely similar if not identical console message as the OP.

    My device is connected, development mode has been enabled (or at least it says Developer options are on in my settings, which I assume is the same thing), and trust has been established.

    I have gotten quick test projects to build from Unity on this computer to this phone. The problem is with a larger more established project. A programmer at a different location is able to get his version of this project to build, but I am not.

    Any suggestions would be most welcome!
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Try building apk and deploy it to device from command line using adb, maybe that will tell something.
    We've also seen cases where cable was the problem, try using different cable or different machine.
     
  5. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    165
    Thanks for the reply. I tried running adb via command line, and here is what I saw in the window after it crunched for a while:

    C:\Users\Owner\AppData\Local\Android\sdk\platform-tools>adb install C:\Development\Builds\FearlessFlyingGearDevelopment\FearlessFlyingDev.apk
    C:\Development\Builds\FearlessFlyingGearDevelopment\FearlessFlyingDev.apk: 1 file pushed. 7.2 MB/s (401636662 bytes in 52.862s)
    pkg: /data/local/tmp/FearlessFlyingDev.apk
    Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

    Does that look OK to you?

    The cable seemed like a possibility because (as I just discovered an hour ago) it had a bit of a flaky connection. Except even with that being the case, it worked well enough that smaller test projects deployed to the phone over the flaky cable without trouble, as long as I didn't move it until it was done. Anyway, it seemed worth a try, so once I replaced the cable I again tried to build from within Unity. Still failed.
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Do you have the same app installed already?
    According stack overflow uninstalling it first can help.
    Search the the web for that INSTALL_PARSE_FAILED_NO_CERTIFICATES
     
  7. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    165
    Good suggestion, but unfortunately I tried that already. Uninstalled every variation of any app with this name I could find, and did my best to search for any app that might be named the same. I even tried renaming the app in the settings in hopes that, if there were a hidden version with the same name, it wouldn't conflict with my build attempt.

    Now, I'm not super familiar with Android phones (I only have this one to build to) so it might be there's an identically named version of the app on there somewhere and I just don't know how to scrub it. Any suggestions along those lines would be welcome.

    And I did try searching for that error, but I should keep at it.

    It's so baffling to the coder on my team (who's remote and can't sit down with it) and so not a problem anyone else online seems to be running into that I'm getting worried I'm doing something obviously and stupidly wrong.

    I really appreciate the help! Please feel free to suggest anything else that might come to mind, even if it seems far-fetched.
     
    Last edited: Feb 23, 2018
  8. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    165
    Update: Got a couple good suggestions from my friend who runs
    Xix Interactive https://assetstore.unity.com/publishers/16151, and one of them finally got it to build.

    The first suggestion was to dig into the Application Manager within the settings on the Android phone and see if I had actually deleted all apps that might have a naming conflict. Being not terribly familiar with Androids, I didn't realize this might have a more complete list of apps than I see in the main UI. Turns out there was one of my builds still on the phone and hidden, and that was good to know, but as it was a different name - the hidden app was called Fearless while the one I was building was called FearlessFlying - it wasn't likely to conflict and indeed deleting it didn't help the problem.

    The second suggestion was to delete the Settings and Library folders. Deleting Settings wiped out some of our custom build tools, so I had to restore the folder and thus wasn't able to test the effectiveness of that step. But deleting Library? Now THAT did the trick. Not sure why, but after deleting the library and letting it rebuild and otherwise chew on things for a while I was able to build and have been able to test on the Gear ever since.

    Thanks again for the suggestions, Aurimas-Cernius.