Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Android Build not wokring on Unity 2018.4.5f1 LTS

Discussion in 'Editor & General Support' started by Wakeel_Ahmed, Aug 28, 2023.

Thread Status:
Not open for further replies.
  1. Wakeel_Ahmed

    Wakeel_Ahmed

    Joined:
    Jan 13, 2017
    Posts:
    12
    Ctrl + B:
    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/Wakeel Furqan Ahmed/AppData/Local/Android/Sdk\platform-tools\adb.exe -s "26eff9ed" install -r "C:\Users\Wakeel Furqan Ahmed\2018versiotesting\testting2018.apk"

    stderr[
    adb: failed to install C:\Users\Wakeel Furqan Ahmed\2018versiotesting\testting2018.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
    ]
    stdout[
    Performing Streamed Install
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.AndroidDevice.Exec (System.String[] command, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.AndroidDevice.Install (System.String apkfile) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.AndroidDeploymentTargetsExtension+<UploadAPK>c__AnonStorey3.<>m__0 () (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.Android.AndroidDeploymentTargetsExtension+LaunchProgressTaskManager taskManager) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.AndroidDeploymentTargetsExtension+<LaunchBuildOnTarget>c__AnonStorey0.<>m__2 () (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
    UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <267278aa48b840c7a0e7281223ea050e>:0)
    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)
    UnityEditor.PostprocessBuildPlayer+<LaunchOnTargets>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:210)
    UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
    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:229)
    UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at <267278aa48b840c7a0e7281223ea050e>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at <267278aa48b840c7a0e7281223ea050e>:0)
    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)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:329)


    upload_2023-8-28_10-48-30.png upload_2023-8-28_10-50-13.png
    upload_2023-8-28_10-50-53.png
    same even with external JDK (recommended in Unity 2018.4 Documentation)
    upload_2023-8-28_10-57-9.png

    manual installation:
    Error on android device: "App not installed as package appears to be invalid".

    What i have done:
    1) Clearing GI cache
    2) clearing data of android device package installer
    3) manual Android Studio installation and Obsolete SDK installation
     

    Attached Files:

    Last edited: Aug 28, 2023
  2. Wakeel_Ahmed

    Wakeel_Ahmed

    Joined:
    Jan 13, 2017
    Posts:
    12
  3. Wakeel_Ahmed

    Wakeel_Ahmed

    Joined:
    Jan 13, 2017
    Posts:
    12
    i just ran on another device and the app build and worked (its Android 11 Realme 6), mines is Redmi Note 11 (Android 13). How i run on my device?
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Not sure if related to your issue but in case you are not aware of this: every year or so Apple and Google require a higher minimum SDK that apps get built with. Eventually the SDK version shipped with Unity 2018 is no longer supported and you will not be able to publish apps built with an old Unity version to mobile stores. Builds may even cease to work on dev devices.

    Given that 2018 is five+ years old it‘s likely that you are going to have issues publishing the app at a minimum.

    Meaning: perhaps take that opportunity and upgrade your Unity version and see if that changes the build behaviour. You will be forced to do so eventually anyway if you want to publish your app.
     
  5. Wakeel_Ahmed

    Wakeel_Ahmed

    Joined:
    Jan 13, 2017
    Posts:
    12
    this is something done different in Android 13 and 12 and I am very interested in fixing it, Abandoning Unity 2018.4 does not sound like a solution, getting the same issue in unity 2021.3 LTS
     
    Last edited: Aug 28, 2023
  6. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    The 2019 docs have some little extra info, it appears you can install other NDKs and select a given API level but 2018 doesn't have this setting documented so I can't say whether it's supported by 2018:
    https://docs.unity3d.com/2019.4/Documentation/Manual/android-sdksetup.html

    You may want to check other Unity versions of this page to see if it matches the necessary API levels for your target devices.

    In any case, I happened to stumble across this post by a Unity staff member, indicating that not even 2021.3 supports the Android 13 API toolchain:
    Perhaps this explains the issue?
    Like I said, eventually you will be forced to upgrade Unity when building for closed platforms (mobile, console).
     
  7. Wakeel_Ahmed

    Wakeel_Ahmed

    Joined:
    Jan 13, 2017
    Posts:
    12
    U guys are not trying to understand the issue. for unity 2021.3.1f1, my Home PC is building app for my Android 13 device, even 2020.3.1f1 is also building and working for android 13. whereas my office PC is not.
    at home and office both, Unity 2018.4 is not working for android 13.
    Cant u guys just seriously research on the issue and help me, upgrading the project is not feasible.
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,561
    Unity2018 is no longer supported.

    The earliest Unity I got to work with Android 13 is Unity2020.3.41f1 (see notes below).

    Even 2020 is no longer supported. I recommend Unity2021 and be prepared to upgrade again next year.

    Then I guess you better just throw it out and make a new one.

    That's not how the forums work.

    Our volunteer job is to help YOU understand the issue(s).

    This is because it will be YOU who will fix (or not) the issue(s).

    Here is 100% of my notes and research, all available for you to work through to solve your problem. GO.

    How to troubleshoot build failures:

    First, make a blank project with a single blank scene and prove that it builds successfully.

    If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

    Until you can build a blank project to the target platform, don't fiddle with anything else.

    Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

    Most often things that prevent building are third-party libraries such as Firebase.

    Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

    It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

    Android build not building:

    Recently (circa July 2022) there have been reports of Unity's installer failing to install the Android Tools.

    https://forum.unity.com/threads/cant-build-for-android.1306098/

    Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022 (edited on August 23, 2023 to include Android SDK 33...):

    https://forum.unity.com/threads/aab...y-2021-3-8-with-jdk-1-8.1322211/#post-8551193

    Android Gradle errors and other related stuff:

    https://forum.unity.com/threads/unity-gradle-bug-please-help.1368018/#post-8625789

    Good luck in your travels!
     
  9. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,955
    No, that is not what this forum is for.
    No one can see what going on with your various computers. Just posting a bunch of screenshots and logs and demanding help isn't appropriate.
    Closed.
     
    Kurt-Dekker likes this.
Thread Status:
Not open for further replies.