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

Gradle build failed

Discussion in 'Android' started by luoyu510183, Mar 20, 2019.

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

    divineiwu01

    Joined:
    Jun 7, 2019
    Posts:
    31
    Clean remove means I just uninstall both the unity hub and editor right?
     
  2. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
  3. divineiwu01

    divineiwu01

    Joined:
    Jun 7, 2019
    Posts:
    31
    Thanks a lot I'm doing it right now
     
  4. mjcpababo9

    mjcpababo9

    Joined:
    Sep 7, 2019
    Posts:
    1
    Gradle build failed.
    I'm using 2019.1.1f ver.
     
  5. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Please provide more info.
     
  6. flintcheeze

    flintcheeze

    Joined:
    Sep 10, 2015
    Posts:
    80
    Please help gradle build failed
    Been searching and trying different means to no avail
     
  7. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    You should provide more info, Error log, Unity Version, Any android plugin you're using in projects.
     
  8. flintcheeze

    flintcheeze

    Joined:
    Sep 10, 2015
    Posts:
    80
    Okay I will
    In a bit
    Did a full uninstall
    Trying to install them back
     
  9. CSDSAdmin

    CSDSAdmin

    Joined:
    Apr 26, 2018
    Posts:
    9
    update Andriod Studio on the update it will ask if you accept the new license for the new version of Andriod SDK etc shut down and restart the computer.
     
  10. Lindy_Springlab

    Lindy_Springlab

    Joined:
    Mar 11, 2019
    Posts:
    2
    Hi there, I'm experiencing a similar issue. Using 2019.2.14f1 and Android, it gives a "Gradle build failed" error when trying to build to a Lenovo tablet (see attachment for full error message).

    I tried deleting and reinstalling every single Unity and Android file I could find, nothing works.
     

    Attached Files:

  11. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    https://github.com/googlesamples/unity-jar-resolver

    Have you installed this and press resolve button? If not try it first.

    If it's still not working please try build empty Unity project for make sure everything is fine.
     
  12. Lindy_Springlab

    Lindy_Springlab

    Joined:
    Mar 11, 2019
    Posts:
    2
    Thanks for your quick reply!
    I have tried this, but it didn't work. I installed 2019.3.0f1 now and all works fine.

    I'm also suspecting it has something to do with trying to load the full project from the cloud (Google Drive), so just to make sure I work with Git now.

    My apologies for not giving a conclusive solution with this, but it might help some of you.
     
  13. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Just upgraded from Unity 2019.2.9 to 2019.2.15 and now Android builds fail using the Unity Hub installed SDk & NDK and OpenJDK....
     
  14. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Check SDK, NDK, JDK version. (Try google it) and rollback to available version. Not sure but maybe this is problems.
     
  15. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    I just returned to 2019.2.9 as there are too many other things changed in 2019.2.15 that break my project
     
  16. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    First - upgrade your android studio and sdk for latest versions
    Second- try to be online while build is in progress, firewalls off or in notifying mode

    These two usually help
     
  17. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    First - upgrade your android studio and sdk for latest versions
    Second- try to be online while build is in progress, firewalls off or in notifying mode

    These two usually help
     
  18. Kalavun

    Kalavun

    Joined:
    Jun 18, 2019
    Posts:
    1
    It works for me thanks:)
     
  19. joseangel03082010

    joseangel03082010

    Joined:
    Jan 28, 2020
    Posts:
    2
    I tried everything, move gradle, go to advance system configuration, desintalls and re-intalls and nothing.


    Console:

    Error: UnityEngine.GUIUtility:processEvent(Int32, IntPtr) FAILURE: Build failed with an exception.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) * What went wrong:

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    A problem occurred configuring project ':launcher'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Could not resolve all artifacts for configuration ':launcher:classpath'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr

    Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.4.0)

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0.jar'.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0.jar'.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > jcenter.bintray.com
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Could not download bcpkix-jdk15on.jar (org.bouncycastle:bcpkix-jdk15on:1.56)

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Could not download bcpkix-jdk15on.jar (org.bouncycastle:bcpkix-jdk15on:1.56)

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) > Could not get resource 'https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > Could not GET 'https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar'.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) > Could not get resource 'https://jcenter.bintray.com/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > Could not GET 'https://jcenter.bintray.com/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar'.
    2. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.21/kotlin-stdlib-1.3.21.jar'.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > jcenter.bintray.com
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    1. > Could not get resource 'https://jcenter.bintray.com/com/sun/xml/fastinfoset/FastInfoset/1.2.13/FastInfoset-1.2.13.jar'.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    CommandInvokationFailure: Gradle build failed. C:/Program Files/Unity/Hub/Editor/2019.3.0f5/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Gradle\gradle-5.4.1\lib\gradle-launcher-5.4.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    BUILD FAILED in 0s ] stdout[

    ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at :0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :0) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at :0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0) UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Build completed with a result of 'Failed' UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    UnityEditor.BuildPlayerWindow+BuildMethodException: 95 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  20. joseangel03082010

    joseangel03082010

    Joined:
    Jan 28, 2020
    Posts:
    2
    Help please
     
  21. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    If you using newest version Unity, I think you don't need to replace version of any ndk, sdk, jdk.
    They're automatic installed on Unity Hub, Unity Installer (If i'm not wrong).
    Right now you have to try to re-install. (By the way clean older version of ndk, sdk, jdk too)

    If it's still error then try to download solved version of ndk, sdk, jdk.
     
  22. EyesWide

    EyesWide

    Joined:
    Jan 31, 2020
    Posts:
    12



    I can't find AppData\Local\Android
    I am using unity 2019.3.0f6
     
  23. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    You need to install Android Build Tool first I think.
     
  24. EyesWide

    EyesWide

    Joined:
    Jan 31, 2020
    Posts:
    12
    I will try. But how to download it
     
    Last edited: Feb 1, 2020
  25. EyesWide

    EyesWide

    Joined:
    Jan 31, 2020
    Posts:
    12
    I download everything again but no good
     
  26. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Did you install everything using the Unity Hub? Paste the full error here.
     
  27. EyesWide

    EyesWide

    Joined:
    Jan 31, 2020
    Posts:
    12
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    FAILURE: Build failed with an exception.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    * What went wrong:

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    A problem occurred configuring project ':launcher'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not resolve all artifacts for configuration ':launcher:classpath'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not resolve com.android.tools.build:gradle:3.4.0.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    Required by:

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    project :launcher

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not resolve com.android.tools.build:gradle:3.4.0.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > dl.google.com

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not resolve com.android.tools.build:gradle:3.4.0.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    > jcenter.bintray.com

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    * Try:

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    * Get more help at https://help.gradle.org

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    BUILD FAILED in 5s

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    CommandInvokationFailure: Gradle build failed.
    E:/unity/2019.3.0f6/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "E:\unity\2019.3.0f6\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring project ':launcher'.
    > Could not resolve all artifacts for configuration ':launcher:classpath'.
    > Could not resolve com.android.tools.build:gradle:3.4.0.
    Required by:
    project :launcher
    > Could not resolve com.android.tools.build:gradle:3.4.0.
    > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.
    > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.
    > dl.google.com
    > Could not resolve com.android.tools.build:gradle:3.4.0.
    > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.
    > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.0/gradle-3.4.0.pom'.
    > jcenter.bintray.com

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 5s
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <501fdf9059b849939e0297808b46ab08>:0)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <501fdf9059b849939e0297808b46ab08>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <501fdf9059b849939e0297808b46ab08>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    Build completed with a result of 'Failed'
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    UnityEditor.BuildPlayerWindow+BuildMethodException: 26 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in <6f28216fea9f453abf2e05b770ed3ee4>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <6f28216fea9f453abf2e05b770ed3ee4>:0
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    Curl error 56: Receiving data failed with unitytls error code 1048578
     
  28. EyesWide

    EyesWide

    Joined:
    Jan 31, 2020
    Posts:
    12
    Yes
     
  29. unity_zq9yV-QwDEEPOA

    unity_zq9yV-QwDEEPOA

    Joined:
    Dec 3, 2019
    Posts:
    2
    Hey guys,

    Also noticed that deleting the Android Studio, installing the missing components from the Unity Hub actually helped.
     
  30. Atakanos

    Atakanos

    Joined:
    Jul 3, 2019
    Posts:
    5
    You usually can receive this error when your project path has been set with ASCII character or Space Folder Names. Control the your Folder Path and try again.
     
  31. cultzone

    cultzone

    Joined:
    Oct 20, 2019
    Posts:
    39
    ok thank you... the folder of the project can be a problem... and the name of the build too... the people says too mantain in the small case all the names of the project...
     
  32. thorhammer2301

    thorhammer2301

    Joined:
    Jan 14, 2020
    Posts:
    10
    in step 4: version of whom to be count there..?
     
  33. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Can you put a screenshot of your step 4?
     
  34. thorhammer2301

    thorhammer2301

    Joined:
    Jan 14, 2020
    Posts:
    10
  35. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    upload_2020-3-10_8-45-53.png

    Try this one as @ shawnlauzon quotes if's doesn't work try another version in this topics.
     
  36. thorhammer2301

    thorhammer2301

    Joined:
    Jan 14, 2020
    Posts:
    10
    i've tried with downloading all the packages and still not working have a look sdk_tools_morepackages.jpg

    and still unity showing this error...
    unity error.jpg
     
  37. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Check this post https://forum.unity.com/threads/set...or-unity-2018-4-18f1-lts.838015/#post-5549776 maybe that is your problem. I'm just guessing, as you haven't provided the actual error you get in the editor's console. Also Unity 5.6 is a very old version, I'm not sure if the latest SDK tools will work with this Unity version.
     
  38. thorhammer2301

    thorhammer2301

    Joined:
    Jan 14, 2020
    Posts:
    10
    sdk tools_obsolete.jpg

    It's already there..
    and ya my unity version is old..but its just working fine with android 10 of mobile..i don't know why not in mine...

    And if i need more of the help from you..kindly let me know where can i contact you..
     
  39. thorhammer2301

    thorhammer2301

    Joined:
    Jan 14, 2020
    Posts:
    10
    unity_console.jpg

    and here is unity console...this much error is there..:(
     
  40. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    You haven't specified on which device you were unable to install, but after googling the error (INSTALL_FAILED_USER_RESTRICTED) I expect you have a Xiaomi device. Google the error yourself and you will find potential solutions such as https://stackoverflow.com/questions...estricted-android-studio-using-redmi-4-device or https://github.com/Genymobile/gnirehtet/issues/99#issuecomment-377767690
    It seems you will have to play with device settings a little bit.
     
    thorhammer2301 likes this.
  41. thorhammer2301

    thorhammer2301

    Joined:
    Jan 14, 2020
    Posts:
    10
    It Worked Fianlly!!..
    Thank you so much..means a lot..
     
  42. FuturePlatform

    FuturePlatform

    Joined:
    Feb 27, 2020
    Posts:
    1
    I solve this problem. Android studio ->tool -> SDK Manager -> install new And update all -> re import unity package.
     
  43. blackbirds98

    blackbirds98

    Joined:
    Mar 5, 2020
    Posts:
    1
    Hi
    Like many, I have a problem with this Error
    I tried all the ways but still the error is not fixed please help me
    I've installed several versions and started the project many times over
    But I didn't succeed
    CommandWithNoStdoutInvokationFailure: Gradle initialization failed.
    UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.AndroidJavaTools.RunJavaWithShellExecute (System.String args, System.String workingdir, System.String error) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.GradleWrapper.WarmupGradle (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingDir, System.String baseCommand) (at <88091cc0f6184c3ca77702906799aea5>:0)
    Rethrow as GradleInvokationException: Gradle initialization failed.
    UnityEditor.Android.GradleWrapper.WarmupGradle (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingDir, System.String baseCommand) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.PostProcessAndroidPlayer+<>c__DisplayClass3_0.<ExecuteWarmup>b__0 () (at <88091cc0f6184c3ca77702906799aea5>:0)
    System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ThreadHelper.ThreadStart () (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)


    FAILURE: Build failed with an exception.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    * What went wrong:

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    This problem might be caused by incorrect configuration of the daemon.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.2.2/userguide/gradle_daemon.html

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Process command line: C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -Xmx409060m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.2.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.2.2


    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Unable to allocate 13089920KB bitmaps for parallel garbage collection for the requested 418877440KB heap.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Starting a Gradle Daemon (subsequent builds will be faster)

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Unity/Hub/Editor/2019.3.7f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.2.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx409060m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.2.2/userguide/gradle_daemon.html
    Process command line: C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -Xmx409060m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.2.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.2.2
    Please read the following process output to find out more:
    -----------------------
    Error occurred during initialization of VM
    Unable to allocate 13089920KB bitmaps for parallel garbage collection for the requested 418877440KB heap.
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.


    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org
    ]
    stdout[
    Starting a Gradle Daemon (subsequent builds will be faster)
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <88091cc0f6184c3ca77702906799aea5>:0)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <88091cc0f6184c3ca77702906799aea5>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <88091cc0f6184c3ca77702906799aea5>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  44. sj631

    sj631

    Joined:
    Dec 23, 2016
    Posts:
    22
    Just remove the newer folders from C:\Users\Your Name\AppData\Local\Android\Sdk\build-tools for making the build
     
  45. idunnuhow

    idunnuhow

    Joined:
    Apr 16, 2014
    Posts:
    23
    @JuliusM
    Hello guys,
    I suddenly got this problem also, yesterday I'm still able to build successfully but now cannot, I opened a new blank project and try build, it success on blank project, I have no idea whats going on, here is the log, hopefully someone can help me on this, thank you very much.

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Unity/Hub/Editor/2019.3.10f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':launcher:packageRelease'.
    > 1 exception was raised by workers:
    java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: value (4298363945) > 0x00000000ffffffffL


    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 5m 28s
    ]
    stdout[

    > Configure project :launcher
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

    > Task :unityLibrary:preBuild UP-TO-DATE
    > Task :launcher:preBuild UP-TO-DATE
    > Task :unityLibrary:preReleaseBuild UP-TO-DATE
    > Task :launcher:prepareLintJar
    > Task :unityLibrary:checkReleaseManifest
    > Task :unityLibrary:processReleaseManifest
    > Task :unityLibrary:compileReleaseAidl NO-SOURCE
    > Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:generateReleaseBuildConfig
    > Task :unityLibrary:generateReleaseResValues
    > Task :unityLibrary:generateReleaseResources
    > Task :launcher:preReleaseBuild
    > Task :launcher:compileReleaseAidl NO-SOURCE
    > Task :launcher:compileReleaseRenderscript NO-SOURCE
    > Task :launcher:checkReleaseManifest
    > Task :launcher:generateReleaseBuildConfig
    > Task :launcher:generateReleaseSources
    > Task :launcher:mainApkListPersistenceRelease
    > Task :launcher:generateReleaseResValues
    > Task :launcher:generateReleaseResources
    > Task :launcher:createReleaseCompatibleScreenManifests
    > Task :unityLibrary:packageReleaseResources
    > Task :launcher:processReleaseManifest
    > Task :unityLibrary:generateReleaseRFile
    > Task :unityLibrary:prepareLintJar
    > Task :unityLibrary:generateReleaseSources
    > Task :unityLibrary:javaPreCompileRelease
    > Task :launcher:mergeReleaseResources
    > Task :launcher:processReleaseResources
    > Task :launcher:mergeReleaseShaders
    > Task :launcher:compileReleaseShaders
    > Task :launcher:generateReleaseAssets
    > Task :launcher:validateSigningRelease
    > Task :launcher:signingConfigWriterRelease
    > Task :launcher:checkReleaseDuplicateClasses
    > Task :launcher:mergeReleaseJniLibFolders
    > Task :launcher:processReleaseJavaRes NO-SOURCE
    > Task :unityLibrary:compileReleaseJavaWithJavac
    > Task :unityLibrary:bundleLibCompileRelease
    > Task :unityLibrary:prepareLintJarForPublish
    > Task :launcher:javaPreCompileRelease
    > Task :unityLibrary:mergeReleaseShaders
    > Task :unityLibrary:compileReleaseShaders
    > Task :unityLibrary:generateReleaseAssets
    > Task :launcher:compileReleaseJavaWithJavac
    > Task :launcher:compileReleaseSources
    > Task :unityLibrary:packageReleaseAssets
    > Task :launcher:lintVitalRelease
    > Task :unityLibrary:bundleLibRuntimeRelease
    > Task :unityLibrary:processReleaseJavaRes NO-SOURCE
    > Task :unityLibrary:bundleLibResRelease
    > Task :unityLibrary:mergeReleaseJniLibFolders
    > Task :unityLibrary:transformNativeLibsWithMergeJniLibsForRelease
    > Task :unityLibrary:transformNativeLibsWithIntermediateJniLibsForRelease
    > Task :launcher:mergeReleaseAssets
    > Task :launcher:transformClassesWithDexBuilderForRelease
    > Task :launcher:transformDexArchiveWithExternalLibsDexMergerForRelease
    > Task :launcher:transformDexArchiveWithDexMergerForRelease
    > Task :launcher:transformNativeLibsWithMergeJniLibsForRelease
    > Task :launcher:transformResourcesWithMergeJavaResForRelease
    > Task :launcher:packageRelease
    > Task :launcher:packageRelease FAILED

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    45 actionable tasks: 45 executed
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c28be54006ad442989ee1a401e08ea78>:0)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c28be54006ad442989ee1a401e08ea78>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: May 7, 2020
  46. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
  47. idunnuhow

    idunnuhow

    Joined:
    Apr 16, 2014
    Posts:
    23
    Thanks for reply, one more question, do you know what kind of situation will suddenly cause this happen? I have no idea why because I can build it before yesterday, and also can build for new blank project right now, thats mean my unity supposed is working well now. Only the current project got problem.
     
  48. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Blank project is not contain anything that conflicted when building to Android.
     
  49. cultzone

    cultzone

    Joined:
    Oct 20, 2019
    Posts:
    39
    ==> gradle version & manifests conflicts... check this version re the same...
     
  50. grafikerinbiri

    grafikerinbiri

    Joined:
    Jul 4, 2020
    Posts:
    1
    Hey guys,

    I've just Solved the same issue:

    • Windows 10
    • UnityHub and Unity 2019.3.15f1
    • SDK, NDK and JDK installed via Unity
    • Google Admob included
    How happened (i really don't know still but i did these):

    1. Uninstall Unity 2019.3.15f1 via UnityHub
    2. Install the latest version 2019.4.2f1 LTS
    3. There was a keystore error which i couldn't see cause of many erros (251 errors)
      1. Deleted the old keystores and created a new one (and also renamed the new one)
    4. Unity > Edit > Project Settings > Player > Publishing Settings
      1. Minify
        1. Release > Gradle (Experimental)
        2. Debug > Gradle (Experimental)
    5. BOOM! :D
    Also tried these before the solution:
    Please read all these steps before take an action for not the get bigger problems :)
    • Deleted the last updated folder from C:\Users\XXX\AppData\Local\Android\sdk\build-tools
      • 28.0.3
      • 29.0.3
      • 30.0.0-rc4 (made a copy before delete)
      • RESTORED: It didn't worked for me and my result is with this folder
    • Changed the Gradle folder:
      • C:\Program Files\Unity\2019.4.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib
      • with lib folder of gradle-6.5.1 downloaded from https://gradle.org/releases/
      • RESTORED: It didn't worked for me and my result is with the old gradle not updated
     
    Fanakartal and AnastasiiaIT like this.
Thread Status:
Not open for further replies.