Search Unity

CommandInvokationFailure: Gradle build failed.

Discussion in 'Editor & General Support' started by Xavier78, Jun 25, 2017.

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

    Asyraf26

    Joined:
    Oct 8, 2017
    Posts:
    1
    Thanks. Its really work for me
     
  2. MihaMarn

    MihaMarn

    Joined:
    Nov 6, 2017
    Posts:
    15
    Have foound a solution: Since I use blutooth with java android plugin I have two androidManifest.xml files in my plugins folder. There is a line in one that coresponds to '<requestedExecutionLevel> found in <manifest>' notation from error report posted in previous post. So I just commented this line out like so: <!---<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->

    Also relavant to this thread:
    I had to select in Player setings:
    Scripting RuntimeVersion: framework 4.x
    API compatibility lever 4.x

    Hope this helps anyone.
     
    lawence likes this.
  3. lawence

    lawence

    Joined:
    Dec 24, 2018
    Posts:
    1
    • #53 Thank you for your answer. It's very useful
     
  4. kapil2808

    kapil2808

    Joined:
    Jul 21, 2018
    Posts:
    1
    I solved this this by just renaming my product name from interface to kapil I think by using product name as interface it was coinciding with Java classes so I just renamed it from player setting
    Hope this helps
     
  5. DaiDepTrai

    DaiDepTrai

    Joined:
    Sep 7, 2018
    Posts:
    1
    Hello Everyone;

    pls help me.

    inbox to facebook of me : https://www.facebook.com/daitichdeptrai

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_201\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[
    D8: Program type already present: android.arch.core.internal.FastSafeIterableMap

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForRelease'.
    > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\0.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\1.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\2.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\3.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\4.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\5.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\6.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\7.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\8.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\9.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\10.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\11.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\12.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\13.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\14.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\15.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\16.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\17.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\18.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\19.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\20.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\21.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\22.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\23.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\24.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\25.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\27.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\28.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\29.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\30.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\31.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\32.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\33.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\36.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\37.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\38.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\39.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\40.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\41.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\42.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\43.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\44.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\45.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\46.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\47.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\48.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\49.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\50.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\51.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\52.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\53.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\54.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\55.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\56.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\57.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\58.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\59.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\62.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\63.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\64.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\65.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\66.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\67.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\68.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\69.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\70.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\71.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\72.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\73.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\74.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\75.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\76.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\77.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\78.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\79.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\80.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\81.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\82.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\83.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\84.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\85.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\86.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\87.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\88.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\89.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\90.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\91.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\92.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\93.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\94.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\95.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\96.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\97.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\98.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\101.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\102.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\103.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\104.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\105.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\106.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\107.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\108.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\109.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\110.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\111.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\112.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\113.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\114.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\115.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\116.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\117.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\118.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\119.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\120.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\121.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\122.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\123.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\124.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\125.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\126.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\127.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\129.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\130.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\131.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\132.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\133.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\134.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\135.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\136.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\137.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\138.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\139.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\140.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\141.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\142.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\143.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\146.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\147.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\148.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\149.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\151.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\153.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\154.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\155.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\156.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\157.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\158.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\159.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\160.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\161.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\162.jar, E:\Project Unity Ice\Spill it\Temp\gradleOut\build\intermediates\transforms\<message truncated>

    upload_2019-2-15_10-51-45.png
     
  6. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Have you got two instances of android.arch.core.internal.FastSafeIterableMap in your project? either directly, or as part of another plugin?
     
  7. hamza_ayoub

    hamza_ayoub

    Joined:
    Jul 10, 2018
    Posts:
    3
    Had the same problem first uninstalled latest jdk i.e: 1.8.201 and installed the previous working one for me 1.8.161 but it didn't help. Uninstalled sdk tool 29.cr2 it solved the problem for me...
     
  8. ngocson16002

    ngocson16002

    Joined:
    Nov 27, 2018
    Posts:
    1
    hey guys. I met one problem. When i add keystore into playersetting. My game can's install. :( so how can i solve it
     
  9. elamigob

    elamigob

    Joined:
    Mar 24, 2019
    Posts:
    1
    Please help.
    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_202\bin\java.exe -classpath "C:\Program Files\Unity2018\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring root project 'gradleOut'.
    > Failed to find Build Tools revision 29.0.0

    * 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 1s
    ]
    stdout[
    Failed to connect to host: https://dl.google.com/android/repository/addons_list-3.xml
    Failed to connect to host: https://dl.google.com/android/repository/addons_list-2.xml
    Failed to connect to host: https://dl.google.com/android/repository/addons_list-1.xml
    Failed to download any source lists!
    java.net.UnknownHostException: dl.google.com
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <e1c3953b4cf040ddb1400046b1c34897>: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 <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Thanks
     
  10. newrangwook777

    newrangwook777

    Joined:
    Apr 23, 2019
    Posts:
    1
    thank you very very much

    Unity ver. 2018.3.11f1
    build system change gradle to Internal
    Error 1,2,3 resolved

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

    2.UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer

    3.CommandInvokationFailure: Gradle build failed.
     
  11. IndieDevMans

    IndieDevMans

    Joined:
    Oct 22, 2018
    Posts:
    3
    [QUOTE = "newrangwook777, post: 4458526, member: 3005005"] большое спасибо

    Единство вер. 2018.3.11f1
    построить систему изменения Gradle на внутренний
    Ошибка 1,2,3 устранена

    1. Сборка завершена с результатом 'Failed'
    UnityEngine.GUIUtility :пrocessEvent (Int32, IntPtr)

    2.UnityEditor.BuildPlayerWindow + BuildMethodException: 2 ошибки
    в UnityEditor.BuildPlayerWindow + DefaultBuildMethods.BuildPlayer

    3.CommandInvokationFailure: Сбой сборки Gradle. [/ QUOTE]
    Hey guys! I've had the same problem, but
    I've found how to fix it.
    First of all, I deleted my custom SDK folder (it used for last versions of unity). Then I went to windows panel and click to java and updated it. And done, now everything works great. I have my installed apk in my device. Try this method guys, it must help.Cheers! ;)
    IMG_20190503_103456.png IMG_20190503_103520.png IMG_20190503_103534.png IMG_20190503_103701.png Скриншот 03-05-2019 10.21.16.png
     
  12. ashavescrow

    ashavescrow

    Joined:
    Apr 19, 2019
    Posts:
    1
    In Build setting change Build system gradle to internal.
     
  13. ziadgapp

    ziadgapp

    Joined:
    Aug 17, 2018
    Posts:
    4
    Make sure your package name is valid (make sure it matches your company name and project name (File > Build Settings > Player Settings - all the way up)). Format should be com.companyname.projectname... haven't read it anywhere, it just worked that way for me :)
     
    mrhsm1 likes this.
  14. xaCoder

    xaCoder

    Joined:
    Jan 10, 2019
    Posts:
    1
    Just unlink the project from unity service and it works!!
     
  15. moaazafzal1111

    moaazafzal1111

    Joined:
    Feb 19, 2018
    Posts:
    1
    In manifest file delete all activities that are not used and also those that create the error. see console where the errors occur in a specific line. In manifest file delete all activities that are not used and also those that create the error. see console where the errors occur in a specific line.
    works fine for me
     
  16. sevyasmel

    sevyasmel

    Joined:
    Jun 24, 2018
    Posts:
    1
    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_221\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.1.9f2\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * Where:
    Build file 'C:\Users\CASPER\Desktop\di�er\Unity ile yapt���m oyunlar\jungle\Temp\gradleOut\build.gradle' line: 20

    * What went wrong:
    A problem occurred evaluating root project 'gradleOut'.
    > Failed to apply plugin [id 'com.android.application']
    > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

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

    BU�LD FAILED in 4s
    ]
    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.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
    UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


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



    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)



    please help.gradle build error. I tried what you wrote but did not.
     

    Attached Files:

  17. RaVen011

    RaVen011

    Joined:
    Oct 31, 2017
    Posts:
    3
    upload_2019-8-27_11-56-35.png

    you just need to change your Minimum API level to 19 hahahaha

    Feel free to message me if you want to understand the problem.
     
    Last edited: Aug 28, 2019
  18. Danyal404

    Danyal404

    Joined:
    Sep 22, 2017
    Posts:
    4
    I m still stuck on this error:( Can anyone help to resolve it?

    CommandInvokationFailure: Failed to re-package resources.
    C:\Users\hp\AppData\Local\Android\Sdk\build-tools\28.0.3\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:\Users\hp\AppData\Local\Android\Sdk\platforms\android-28\android.jar" -F bin/resources.ap_ --extra-packages com.consoliads.mediation.adcolony:com.consoliads.mediation.admob:com.consoliads.mediation.applovin:com.applovin.sdk:android.support.v7.cardview:com.consoliads.mediation.consoliads:com.consoliads.mediation:com.consoliads.consoliadsplugin:com.consoliads.mediation.ironsource:com.consoliads.cache.loaderlibrary:com.unity3d.ads:com.consoliads.mediation.unityads:com.consoliads.mediation.vungle -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\adcolony-mediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\admob-mediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-mediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-sdk-9.7.2\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\cardview-v7-23.0.0\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliadsmediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliadsplugin\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\ironsource-mediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\loaderlibrary\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\unityads-mediation\res" -S "D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\vungle-mediation\res"
    stderr[
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\admob-mediation\res\layout\ad_unified.xml:128: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\admob-mediation\res\layout\ad_unified.xml:88: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\admob-mediation\res\layout\ad_unified.xml:36: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <ImageView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\admob-mediation\res\layout\ad_unified.xml: note: using v17 attributes; synthesizing resource com.KidsGamesfree.daddyhelperFun:layout/ad_unified for configuration v17.
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-mediation\res\layout\applovin_native_ad.xml:69: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <FrameLayout>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-mediation\res\layout\applovin_native_ad.xml:69: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <FrameLayout>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-mediation\res\layout\applovin_native_ad.xml:9: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <LinearLayout>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-mediation\res\layout\applovin_native_ad.xml:9: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <LinearLayout>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-mediation\res\layout\applovin_native_ad.xml: note: using v17 attributes; synthesizing resource com.KidsGamesfree.daddyhelperFun:layout/applovin_native_ad for configuration v17.
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliadsplugin\res\layout\consoli_banner.xml:77: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <ImageView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliadsplugin\res\layout\consoli_banner.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <RelativeLayout>
    :\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:113: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMaxTextSize from <com.consoliads.sdk.nativeads.ActionButton>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:113: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <com.consoliads.sdk.nativeads.ActionButton>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:113: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <com.consoliads.sdk.nativeads.ActionButton>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMinTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMinTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMaxTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMinTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMaxTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <com.consoliads.sdk.nativeads.AdChoices>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml: note: using v17 attributes; synthesizing resource com.KidsGamesfree.daddyhelperFun:layout/consoli_native_ad for configuration v17.
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-sdk-9.7.2\res\layout\mediation_debugger_list_section.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-sdk-9.7.2\res\layout\mediation_debugger_list_section.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\applovin-sdk-9.7.2\res\layout\mediation_debugger_list_section.xml: note: using v17 attributes; synthesizing resource com.KidsGamesfree.daddyhelperFun:layout/mediation_debugger_list_section for configuration v17.
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:113: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <com.consoliads.sdk.nativeads.ActionButton>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:113: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <com.consoliads.sdk.nativeads.ActionButton>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMinTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMaxTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:97: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMinTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:84: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeTextType from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMinTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeMaxTextSize from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml:56: note: removing attribute http://schemas.android.com/apk/res/android:autoSizeStepGranularity from <TextView>
    D:\HelpDaddyMessyhomeAdventure\HelpDaddyMessyhomeAdventure\Temp\StagingArea\android-libraries\consoliads-mediation\res\layout\consoli_native_ad.xml: note: using v22 attributes; synthesizing<message truncated>
     
  19. jhon143

    jhon143

    Joined:
    Sep 26, 2019
    Posts:
    3
    Uptotdate with latest plugin folder of jdk and build it again
     
  20. ngoson107

    ngoson107

    Joined:
    Jun 15, 2016
    Posts:
    1
    thanks bro, you save my life :D
     
  21. tataygames

    tataygames

    Joined:
    Aug 4, 2016
    Posts:
    55
    I had this problem In building on my windows 10. using Unity 2017
    For me the SOLUTION IS:
    Go to your Android folder -> sdk -> build-tools->
    remove every folder that have other versions on it, EXCEPT the VERSION 28.0.3

    Pls see attached file. for screenshot.
    Im solving this half a day. and now its finally working and building the apk,
    hope others fix the issue too.
     

    Attached Files:

    Last edited: May 8, 2020
  22. lwphantom

    lwphantom

    Joined:
    Sep 28, 2019
    Posts:
    1
    CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Hub\Editor\2020.1.3f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.1.3f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx256m" "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 download fastutil.jar (it.unimi.dsi:fastutil:7.2.0)
    > Could not get resource 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
    > Could not GET 'https://d29vzk4ow07wi7.cloudfront.n...Z3N-H7ay3Q__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA'.
    > d29vzk4ow07wi7.cloudfront.net

    * 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 14s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <e4fc6203685a43839d4e68a47c433fd3>: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 <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e4fc6203685a43839d4e68a47c433fd3>: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 <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e4fc6203685a43839d4e68a47c433fd3>: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 <e4fc6203685a43839d4e68a47c433fd3>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <e4fc6203685a43839d4e68a47c433fd3>: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 <b889bab4bdb64142b64a1df71b2eb851>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  23. Waleedraj

    Waleedraj

    Joined:
    Oct 14, 2020
    Posts:
    2
    just turn of ads in unity services
     
  24. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    43
    In my case changing/disabling the "keystore" solved the problem
     
  25. cozilas

    cozilas

    Joined:
    May 7, 2017
    Posts:
    1
    set to true "Realease" and "Debug" in project settings
     

    Attached Files:

  26. haroongamepace

    haroongamepace

    Joined:
    Feb 8, 2021
    Posts:
    2
    Change scripting backend from mono to IL2CPP............ it worked for me
     
  27. Phoenix_XR

    Phoenix_XR

    Joined:
    Mar 21, 2021
    Posts:
    1
    I am getting Gradle Build Failed error while building my app.
    Full error message :---
    CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2020.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

    SEND HELP ;,,(
     
  28. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    @Phoenix_XR This is not the complete error. Can you please post the full error from the build log ?
     
  29. LunarExGames

    LunarExGames

    Joined:
    Feb 18, 2015
    Posts:
    44
    For me it was a Vuforia project - I was upgrading it from 2017 to 2018 and somewhere along the way there were a lot of conflicts but got this error message. Just an FYI in case you are using Vuforia - try a complete removal, manually if you need to - and then reimport. Project works again!
     
  30. joshih195

    joshih195

    Joined:
    Jun 4, 2021
    Posts:
    2
    Please help me with this, i tried almost all methods (which are available on internet) but didn't get any solution. My unity version is 2019.4.28f1.

    ERROR:
    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Unity/Hub/Editor/2019.4.28f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\gradle-5.6.4\lib\gradle-launcher-5.6.4.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'.
    > Shreeji
    > 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'.
    > Shreeji
    * 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 7s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[
    Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <d76da2c9a45b4b02b93f56ae560b1d44>: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 <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d76da2c9a45b4b02b93f56ae560b1d44>: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 <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d76da2c9a45b4b02b93f56ae560b1d44>: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 <d76da2c9a45b4b02b93f56ae560b1d44>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <d76da2c9a45b4b02b93f56ae560b1d44>: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 <bd70c40e01f641bdb7d836e1e97755bc>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  31. AirAura01

    AirAura01

    Joined:
    Jul 23, 2021
    Posts:
    2
    Hi there, anyone building a game for android using unity 2020 may try changing the location where the apk is to be created. Also, try setting the "Run Device" to "All compatible devices" and then finally press the "Build And Run" button. Hope it works :)
     
  32. joshih195

    joshih195

    Joined:
    Jun 4, 2021
    Posts:
    2
    Thank you @AirAura01 for your solution. I'll definitely work on it.
     
  33. thaiwas

    thaiwas

    Joined:
    May 1, 2018
    Posts:
    8
    Had the same error, turns out I was out of disk space ^^
     
  34. LudovicArnould

    LudovicArnould

    Joined:
    Jan 29, 2022
    Posts:
    4
  35. Alcark

    Alcark

    Joined:
    Dec 22, 2021
    Posts:
    1
    Hey guys.
    It is important to read the entire error message that appears in console (I didn't and that was my mistake).
    In my case I tried all the above suggestions and they didn't work for me. But when I read the error, I noticed a line that said something like "R.txt Invalid data". That file was not being generated correctly, because of the antivirus.
    I disabled the antivirus and it worked perfectly (even using all other default parameters).

    It seems that this error has many variants. So we have to try different methods. Thanks for the suggestions.
     
    The_programer212 likes this.
  36. ALIENPANDA

    ALIENPANDA

    Joined:
    Jan 14, 2020
    Posts:
    32
    I too had these kinds of a similar issues in 2020.3.15. The method I tried to solve this is to delete all the android resolved dependencies from the plugin folder and then force resolve. Then take a build.

    Hope it works fine for you.
     
  37. CapitalKage

    CapitalKage

    Joined:
    Jan 8, 2021
    Posts:
    2
    Hi All,

    I was having a similar problem related to Cloud Once. If you have this plug-in installed make sure that all the settings in the project settings are correct.

    If you have any plug-in's make sure they are not also generating these manifest files with the same name.
     
  38. Castaways

    Castaways

    Joined:
    Jan 27, 2022
    Posts:
    1
  39. Emilyyy123456

    Emilyyy123456

    Joined:
    Oct 19, 2022
    Posts:
    1
    Hi All,

    It's nice to see this platform where everyone is helping each other with their knowledge, you can check the issue by going to settings, there must be some plugin issue which can be easily resolved. for detailed guidance you can check https://techkluster.com/
     
  40. nir_unity198

    nir_unity198

    Joined:
    Jun 13, 2022
    Posts:
    5
    strangly, this error still persists
    I use Unity 2020.3.35
    jdk1.8.0_331
    due to failiour to redirect the unity to the SDK folder, I moved all the downloaded SDKs to the default SDK folder
    upload_2022-10-20_18-37-29.png
    but originally had only 30 in there

    I use default gradle but also tested
    upload_2022-10-20_18-38-16.png

    I had AVPRO 1.x installed but once I upgraded to AVPRO 2.x and resolved all the "you have a dupe" conflicts, I was left with this lovely error
    upload_2022-10-20_18-39-31.png

    Code (CSharp):
    1. CommandInvokationFailure: Gradle build failed.
    2. C:\Program Files\Java\jdk1.8.0_331\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
    3.  
    4. stderr[
    5. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    6. Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
    7. Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
    8. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
    9. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
    10. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
    11. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
    12. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
    13. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
    14.  
    15. FAILURE: Build failed with an exception.
    16.  
    17. * What went wrong:
    18. Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
    19. > 1 exception was raised by workers:
    20.   java.lang.RuntimeException: Duplicate class com.twobigears.audio360exo.BuildConfig found in modules audio360-exo.jar (audio360-exo.jar) and audio360-exo28.jar (audio360-exo28.jar)
    21.   Duplicate class com.twobigears.audio360exo2.Audio360Sink found in modules audio360-exo.jar (audio360-exo.jar) and audio360-exo28.jar (audio360-exo28.jar)
    22.   Duplicate class com.twobigears.audio360exo2.OpusDecoder found in modules audio360-exo.jar (audio360-exo.jar) and audio360-exo28.jar (audio360-exo28.jar)
    23.   Duplicate class com.twobigears.audio360exo2.OpusDecoderException found in modules audio360-exo.jar (audio360-exo.jar) and audio360-exo28.jar (audio360-exo28.jar)
    24.   Duplicate class com.twobigears.audio360exo2.OpusJNI found in modules audio360-exo.jar (audio360-exo.jar) and audio360-exo28.jar (audio360-exo28.jar)
    25.   Duplicate class com.twobigears.audio360exo2.OpusRenderer found in modules audio360-exo.jar (audio360-exo.jar) and audio360-exo28.jar (audio360-exo28.jar)
    26.  
    27.   Go to the documentation to learn how to Fix dependency resolution errors.
    28.  
    29.  
    30. * Try:
    31. 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.
    32.  
    33. * Get more help at https://help.gradle.org
    34.  
    35. BUILD FAILED in 2s
    36. ]
    37. stdout[
    38.  
    39. > Configure project :launcher
    40. WARNING: The option setting 'android.enableR8=false' is deprecated.
    41. It will be removed in version 5.0 of the Android Gradle plugin.
    42. You will no longer be able to disable R8
    43. Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
    44. ... (repeats the same line)
    45.  
    Ideas
     
  41. ansi_here03

    ansi_here03

    Joined:
    Jan 7, 2021
    Posts:
    2
    did you find any solution ?
     
  42. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,740
    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:

    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
     
  43. dfm31

    dfm31

    Joined:
    Dec 19, 2022
    Posts:
    2
    I had the same error and was able to fix it by choosing Oculus Quest 2 as the run device, instead of "Default", for an Android build
     
Thread Status:
Not open for further replies.