Search Unity

Gradle prewarm failed in 2018.3

Discussion in 'Android' started by ortin, Jan 3, 2019.

  1. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    I'm trying to move to 2018.3 from 2018.2 and cannot get android batch mode build working (ios and webgl work fine). Here's the error I see in the log:
    Did anyone encounter this problem?
     
    wmadwand and Duggo42 like this.
  2. Duggo42

    Duggo42

    Joined:
    May 21, 2012
    Posts:
    5
    Having similar issue when trying to build to Android:
     
  3. vuplex

    vuplex

    Joined:
    May 11, 2017
    Posts:
    8
    I just ran into this error when I switched from "Export Project" to a regular Android build, and the error went away after I did these two things:

    - Upgraded to the latest version of Android Studio (3.2.1)
    - Upgraded to Gradle 4.6 when it prompted me to

    I suspect that updating Gradle is what solved the issue. Now I'm able to build directly from Unity again.
     
    EdgelessCorner likes this.
  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Our best people are looking into the issue.
     
  5. Duggo42

    Duggo42

    Joined:
    May 21, 2012
    Posts:
    5
    @binarynate: Thanks for the response. My Android Studio and its plugins all claim to be up to date, but I'm still having the issue.

    @Yury-Habets: I'll keep checking in, thanks.
     
  6. motorious

    motorious

    Joined:
    Jun 25, 2016
    Posts:
    11
    For me, upgrading to the latest Android SDK fixed the issue.
     
  7. ChandanKolaparthy

    ChandanKolaparthy

    Joined:
    Dec 9, 2016
    Posts:
    10
    I got the same issue when I updated to unity 2018.3.2f1. fixed it by just updating Android sdk when it prompted me to
     
  8. tonycsharks

    tonycsharks

    Joined:
    Dec 31, 2015
    Posts:
    27
  9. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    139
    Me too facing the same issue.Iam having asset bundles in my project.Android SDK is already updated to latest.Unity Version is 2018.3.3f1
     
  10. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Do you get any additional errors? Previously the actual errors were not printed to the console, but after the fix the errors that caused prewarm to fail should be printed to the editor console.
     
  11. tonycsharks

    tonycsharks

    Joined:
    Dec 31, 2015
    Posts:
    27
    The only errors that I got were this:

    Code (CSharp):
    1. CommandWithNoStdoutInvokationFailure: Gradle prewarm failed.
    2. UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <492d67763d4d482e8616a9848b18ccab>:0)
    3. UnityEditor.Android.AndroidJavaTools.RunJavaWithShellExecute (System.String args, System.String workingdir, System.String error) (at <492d67763d4d482e8616a9848b18ccab>:0)
    4. UnityEditor.Android.GradleWrapper.WarmupGradle (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String baseCommand) (at <492d67763d4d482e8616a9848b18ccab>:0)
    5. UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <492d67763d4d482e8616a9848b18ccab>:0)
    6. UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <492d67763d4d482e8616a9848b18ccab>:0)
    7. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <492d67763d4d482e8616a9848b18ccab>:0)
    8. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    I have explained this issue in this post: https://forum.unity.com/threads/gradle-prewarm-failed-in-unity-2018-3-3f1.620206/

    Can you please check this. Because of this issue, our project is too late now.
     
  12. NinjaCat

    NinjaCat

    R&D Minion

    Joined:
    Aug 22, 2013
    Posts:
    69
    Hi, currently there's still an issue with the prewarm error not giving any meaningful information. We've got a fix for that and it should be coming to 18.3 soon.

    This error is the result of a gradle build failure. You should still be able to get the actual error by either using 18.2 or by exporting as a gradle project and trying to build it with android studio. Fixing the underlying error should make the prewarm error disappear.
     
  13. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    Just want to note that though using 18.2 is mentioned as workaround, my problem appeared just after I moved to 18.3 and with 18.2 everything works just fine.
     
  14. NinjaCat

    NinjaCat

    R&D Minion

    Joined:
    Aug 22, 2013
    Posts:
    69
    Does the problem happen with batchmode builds only or does it affect regular android builds as well? Could you please send us a bug report with a project that can be used recreate the issue?
     
  15. andersemil

    andersemil

    Joined:
    Feb 2, 2015
    Posts:
    112
  16. AlexSD3

    AlexSD3

    Unity Technologies

    Joined:
    Sep 18, 2017
    Posts:
    1
    I can confirm that upgrading the Android SDK fixed the issue on 2018.3.3f1, either normal build or command line build
     
  17. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    Hi,

    I've upgraded my project to 2018.3.4f1 and trying to build my game with IL2CPP for the first time, but keep getting the gradle prewarm error. I'm running the latest version of SDK and build tools and the OpenJDK and NDK r16b.

    There isn't much in the way of useful output that I can see - it doesn't mean much to me:

    Code (csharp):
    1.  
    2. Build completed with a result of 'Failed'
    3. 0x0000000141415828 (Unity) StackWalker::GetCurrentCallstack
    4. 0x000000014141BCD6 (Unity) StackWalker::ShowCallstack
    5. 0x00000001412FF55B (Unity) GetStacktrace
    6. 0x00000001401432FE (Unity) DebugStringToFile
    7. 0x0000000141786EED (Unity) DebugLogHandler_CUSTOM_Internal_Log
    8. 0x0000000054CC5760 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    9. 0x0000000054CC5633 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    10. 0x0000000054CC4EB5 (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    11. 0x0000000012512FE9 (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    12. 0x00000000484E8343 (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:190] UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
    13. 0x000000001135F14B (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:97] UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
    14. 0x00000000111FB353 (Mono JIT Code) [BuildPlayerWindow.cs:908] UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
    15. 0x00000000111AA28B (Mono JIT Code) [BuildPlayerWindow.cs:809] UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
    16. 0x0000000011189B5B (Mono JIT Code) [BuildPlayerWindow.cs:411] UnityEditor.BuildPlayerWindow:OnGUI ()
    17. 0x00000000413170C0 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    18. 0x00007FF8CBCCBE4B (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
    19. 0x00007FF8CBC51E32 (mono-2.0-bdwgc) [object.c:2919] do_runtime_invoke
    20. 0x00007FF8CBC5B012 (mono-2.0-bdwgc) [object.c:3071] mono_runtime_invoke_checked
    21. 0x00007FF8CBC5B7A9 (mono-2.0-bdwgc) [object.c:5262] mono_runtime_try_invoke_array
    22. 0x00007FF8CBC5AFA6 (mono-2.0-bdwgc) [object.c:5140] mono_runtime_invoke_array_checked
    23. 0x00007FF8CBBFFED4 (mono-2.0-bdwgc) [icall.c:3358] ves_icall_InternalInvoke
    24. 0x0000000043AEDBD6 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    25. 0x0000000043AEC1DB (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    26. 0x000000003FFC922F (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
    27. 0x0000000048047FB3 (Mono JIT Code) [HostView.cs:342] UnityEditor.HostView:Invoke (string,object)
    28. 0x0000000048047E13 (Mono JIT Code) [HostView.cs:337] UnityEditor.HostView:Invoke (string)
    29. 0x00000000111886D3 (Mono JIT Code) [HostView.cs:130] UnityEditor.HostView:OldOnGUI ()
    30. 0x0000000048628B0C (Mono JIT Code) [IMGUIContainer.cs:244] UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool)
    31. 0x0000000048626EBB (Mono JIT Code) [IMGUIContainer.cs:440] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect)
    32. 0x0000000011E76943 (Mono JIT Code) [IMGUIContainer.cs:421] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event)
    33. 0x000000004803E6FB (Mono JIT Code) [IMGUIContainer.cs:401] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent (UnityEngine.Experimental.UIElements.EventBase)
    34. 0x000000004801AC94 (Mono JIT Code) [EventDispatcher.cs:516] UnityEngine.Experimental.UIElements.EventDispatcher:ProcessEvent (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.IPanel)
    35. 0x00000000480140EB (Mono JIT Code) [EventDispatcher.cs:308] UnityEngine.Experimental.UIElements.EventDispatcher:Dispatch (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.IPanel,UnityEngine.Experimental.UIElements.DispatchMode)
    36. 0x0000000048013BB3 (Mono JIT Code) [Panel.cs:177] UnityEngine.Experimental.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.DispatchMode)
    37. 0x00000000485FA2C3 (Mono JIT Code) [UIElementsUtility.cs:248] UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel)
    38. 0x00000000485F9A2B (Mono JIT Code) [UIElementsUtility.cs:68] UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent (int,intptr)
    39. 0x00000000485F9394 (Mono JIT Code) [GUIUtility.cs:179] UnityEngine.GUIUtility:ProcessEvent (int,intptr)
    40. 0x00000000485F95B3 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
    41. 0x00007FF8CBCCBE4B (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
    42. 0x00007FF8CBC51E32 (mono-2.0-bdwgc) [object.c:2919] do_runtime_invoke
    43. 0x00007FF8CBC5AE3F (mono-2.0-bdwgc) [object.c:2966] mono_runtime_invoke
    44. 0x0000000140C02AAA (Unity) scripting_method_invoke
    45. 0x0000000140BF30BA (Unity) ScriptingInvocation::Invoke
    46. 0x0000000140BED11A (Unity) ScriptingInvocation::Invoke<bool>
    47. 0x000000014042E70C (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
    48. 0x000000014129116C (Unity) GUIView::ProcessRetainedMode
    49. 0x000000014147A5E0 (Unity) GUIView::OnInputEvent
    50. 0x000000014129107C (Unity) GUIView::ProcessInputEvent
    51. 0x000000014147BC7C (Unity) GUIView::ProcessEventMessages
    52. 0x0000000141471B0F (Unity) GUIView::GUIViewWndProc
    53. 0x00007FF91F3D6D41 (USER32) CallWindowProcW
    54. 0x00007FF91F3D6713 (USER32) DispatchMessageW
    55. 0x000000014149836F (Unity) MainMessageLoop
    56. 0x0000000141499E66 (Unity) WinMain
    57. 0x000000014247DE8A (Unity) __scrt_common_main_seh
    58. 0x00007FF91DDE3034 (KERNEL32) BaseThreadInitThunk
    59. 0x00007FF920483691 (ntdll) RtlUserThreadStart
    60.  
    61. (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
    62.  
    63. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    64.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    65.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96
    66. 0x0000000141415828 (Unity) StackWalker::GetCurrentCallstack
    67. 0x000000014141BCD6 (Unity) StackWalker::ShowCallstack
    68. 0x00000001412FF55B (Unity) GetStacktrace
    69. 0x00000001401432FE (Unity) DebugStringToFile
    70. 0x0000000141786EED (Unity) DebugLogHandler_CUSTOM_Internal_Log
    71. 0x0000000054CC5760 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    72. 0x0000000054CC5633 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    73. 0x0000000054CC4EB5 (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    74. 0x0000000012512FE9 (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    75. 0x000000001135F2CB (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:102] UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
    76. 0x00000000111FB353 (Mono JIT Code) [BuildPlayerWindow.cs:908] UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
    77. 0x00000000111AA28B (Mono JIT Code) [BuildPlayerWindow.cs:809] UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
    78. 0x0000000011189B5B (Mono JIT Code) [BuildPlayerWindow.cs:411] UnityEditor.BuildPlayerWindow:OnGUI ()
    79. 0x00000000413170C0 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    80. 0x00007FF8CBCCBE4B (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
    81. 0x00007FF8CBC51E32 (mono-2.0-bdwgc) [object.c:2919] do_runtime_invoke
    82. 0x00007FF8CBC5B012 (mono-2.0-bdwgc) [object.c:3071] mono_runtime_invoke_checked
    83. 0x00007FF8CBC5B7A9 (mono-2.0-bdwgc) [object.c:5262] mono_runtime_try_invoke_array
    84. 0x00007FF8CBC5AFA6 (mono-2.0-bdwgc) [object.c:5140] mono_runtime_invoke_array_checked
    85. 0x00007FF8CBBFFED4 (mono-2.0-bdwgc) [icall.c:3358] ves_icall_InternalInvoke
    86. 0x0000000043AEDBD6 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    87. 0x0000000043AEC1DB (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    88. 0x000000003FFC922F (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
    89. 0x0000000048047FB3 (Mono JIT Code) [HostView.cs:342] UnityEditor.HostView:Invoke (string,object)
    90. 0x0000000048047E13 (Mono JIT Code) [HostView.cs:337] UnityEditor.HostView:Invoke (string)
    91. 0x00000000111886D3 (Mono JIT Code) [HostView.cs:130] UnityEditor.HostView:OldOnGUI ()
    92. 0x0000000048628B0C (Mono JIT Code) [IMGUIContainer.cs:244] UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool)
    93. 0x0000000048626EBB (Mono JIT Code) [IMGUIContainer.cs:440] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect)
    94. 0x0000000011E76943 (Mono JIT Code) [IMGUIContainer.cs:421] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event)
    95. 0x000000004803E6FB (Mono JIT Code) [IMGUIContainer.cs:401] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent (UnityEngine.Experimental.UIElements.EventBase)
    96. 0x000000004801AC94 (Mono JIT Code) [EventDispatcher.cs:516] UnityEngine.Experimental.UIElements.EventDispatcher:ProcessEvent (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.IPanel)
    97. 0x00000000480140EB (Mono JIT Code) [EventDispatcher.cs:308] UnityEngine.Experimental.UIElements.EventDispatcher:Dispatch (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.IPanel,UnityEngine.Experimental.UIElements.DispatchMode)
    98. 0x0000000048013BB3 (Mono JIT Code) [Panel.cs:177] UnityEngine.Experimental.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.DispatchMode)
    99. 0x00000000485FA2C3 (Mono JIT Code) [UIElementsUtility.cs:248] UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel)
    100. 0x00000000485F9A2B (Mono JIT Code) [UIElementsUtility.cs:68] UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent (int,intptr)
    101. 0x00000000485F9394 (Mono JIT Code) [GUIUtility.cs:179] UnityEngine.GUIUtility:ProcessEvent (int,intptr)
    102. 0x00000000485F95B3 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
    103. 0x00007FF8CBCCBE4B (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
    104. 0x00007FF8CBC51E32 (mono-2.0-bdwgc) [object.c:2919] do_runtime_invoke
    105. 0x00007FF8CBC5AE3F (mono-2.0-bdwgc) [object.c:2966] mono_runtime_invoke
    106. 0x0000000140C02AAA (Unity) scripting_method_invoke
    107. 0x0000000140BF30BA (Unity) ScriptingInvocation::Invoke
    108. 0x0000000140BED11A (Unity) ScriptingInvocation::Invoke<bool>
    109. 0x000000014042E70C (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
    110. 0x000000014129116C (Unity) GUIView::ProcessRetainedMode
    111. 0x000000014147A5E0 (Unity) GUIView::OnInputEvent
    112. 0x000000014129107C (Unity) GUIView::ProcessInputEvent
    113. 0x000000014147BC7C (Unity) GUIView::ProcessEventMessages
    114. 0x0000000141471B0F (Unity) GUIView::GUIViewWndProc
    115. 0x00007FF91F3D6D41 (USER32) CallWindowProcW
    116. 0x00007FF91F3D6713 (USER32) DispatchMessageW
    117. 0x000000014149836F (Unity) MainMessageLoop
    118. 0x0000000141499E66 (Unity) WinMain
    119. 0x000000014247DE8A (Unity) __scrt_common_main_seh
    120. 0x00007FF91DDE3034 (KERNEL32) BaseThreadInitThunk
    121. 0x00007FF920483691 (ntdll) RtlUserThreadStart
    122.  
    123. (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
    124.  

    I'm using the built in gradle file and a custom proguard as follows:

    Code (csharp):
    1.  
    2. # For communication with AdColony's WebView
    3. -keepclassmembers class * {
    4.     @android.webkit.JavascriptInterface <methods>;
    5. }
    6. # Keep ADCNative class members unobfuscated
    7. -keepclassmembers class com.adcolony.sdk.ADCNative** {
    8.     *;
    9.  }
    10.  
    11.  
    12. -keepattributes SourceFile,LineNumberTable
    13. -keep class com.inmobi.** { *; }
    14. -dontwarn com.inmobi.**
    15. -keep public class com.google.android.gms.**
    16. -dontwarn com.google.android.gms.**
    17. -dontwarn com.squareup.picasso.**
    18. -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
    19.      public *;
    20. }
    21. -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
    22.      public *;
    23. }
    24. # skip the Picasso library classes
    25. -keep class com.squareup.picasso.** {*;}
    26. -dontwarn com.squareup.picasso.**
    27. -dontwarn com.squareup.okhttp.**
    28. # skip Moat classes
    29. -keep class com.moat.** {*;}
    30. -dontwarn com.moat.**
    31. # skip AVID classes
    32. -keep class com.integralads.avid.library.* {*;}
    33.  
    34. #Unity
    35. # Keep filenames and line numbers for stack traces
    36. -keepattributes SourceFile,LineNumberTable
    37. # Keep JavascriptInterface for WebView bridge
    38. -keepattributes JavascriptInterface
    39. # Sometimes keepattributes is not enough to keep annotations
    40. -keep class android.webkit.JavascriptInterface {
    41.    *;
    42. }
    43. # Keep all classes in Unity Ads package
    44. -keep class com.unity3d.ads.** {
    45.    *;
    46. }
    47. # Keep all classes in Unity Services package
    48. -keep class com.unity3d.services.** {
    49.    *;
    50. }
    51. -dontwarn com.google.ar.core.**
    52. -dontwarn com.unity3d.services.**
    53. -dontwarn com.ironsource.adapters.unityads.**
    54.  
    55.  
    56. # Vungle
    57. -keep class com.vungle.warren.** { *; }
    58. -dontwarn com.vungle.warren.error.VungleError$ErrorCode
    59. # Moat SDK
    60. -keep class com.moat.** { *; }
    61. -dontwarn com.moat.**
    62. # Okio
    63. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
    64. # Retrofit
    65. -dontwarn okio.**
    66. -dontwarn retrofit2.Platform$Java8
    67. # Gson
    68. -keepattributes Signature
    69. -keepattributes *Annotation*
    70. -dontwarn sun.misc.**
    71. -keep class com.google.gson.examples.android.model.** { *; }
    72. -keep class * implements com.google.gson.TypeAdapterFactory
    73. -keep class * implements com.google.gson.JsonSerializer
    74. -keep class * implements com.google.gson.JsonDeserializer
    75. # Google Android Advertising ID
    76. -keep class com.google.android.gms.internal.** { *; }
    77. -dontwarn com.google.android.gms.ads.identifier.**
    78.  
    79. # UTNotifications Proguard Config (please do not edit)
    80. -keep public class universal.tools.notifications.* { *; }
    81. -dontwarn com.amazon.device.messaging.*
    82. -dontwarn universal.tools.notifications.AdmIntentService
    83.  

    I've tried several different ways of making this work - examples of the mainTemplate.gradle I've found surrounding this issue, but nothing seems to fix it on my local machine.

    To note - it does build if I use Mono rather than IL2CPP and it appears to also work on Cloud Build - just not locally

    Thanks in advanced

    Alan
     
    Last edited: Feb 5, 2019
  18. temavrn

    temavrn

    Joined:
    Sep 17, 2018
    Posts:
    4
    Upgraded sdk to 3.2.1 Unity 2018 3.3
    but still:

    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    5.  
     
  19. adeelbabu

    adeelbabu

    Joined:
    May 24, 2017
    Posts:
    2
    Solved !! (Unity 2018.3.3)
    After Updating Android Studio To Latest Version
     
  20. andersemil

    andersemil

    Joined:
    Feb 2, 2015
    Posts:
    112
    You need to include more of your log before we can help you. The lines you included are just the summary.

    Most likely you still have a custom gradle template which refers to the older sdk?
     
  21. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    I managed to fix mine by reinstalling the latest build tools. I removed 28.0.3 and let Unity install it again and then it started working for me... very odd!
     
  22. WyrmCS

    WyrmCS

    Joined:
    Nov 9, 2014
    Posts:
    24
    How did you get Unity to reinstall SDK for you?
     
  23. Codemilker

    Codemilker

    Joined:
    Dec 10, 2018
    Posts:
    40
    Just updating everything didn't solve it for me. However, after doing the following steps inside the Build Settings I didn't get the "Gradle prewarm failed" message again and the deployment was successful:

    1. Set "Build System" to "Internal (deprecated)" and deployed successfully to my Android phone
    2. Set "Build System" back to "Gradle" and surprisingly deployed successfully to my Android phone again

    The build with "Gradle" as Build System in step 2 took a bit longer as apparently Unity was downloading something in the background (and fixing everything automatically). After this, further deployments were quick and worked like a charm.
     
  24. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99

    When I removed version 28.0.3 of the build tools using Android Studio and tried to build using Unity 2018.3.4, it prompted me at the start of the build to update my tools, so I let it happen. This seemed to fix it then
     
  25. nadh

    nadh

    Joined:
    Dec 9, 2012
    Posts:
    2
    Solved by downgrading Build tools version from 29.0.0-rc1 to 28.0.2
     
  26. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    We are improving the behavior of Unity with RC versions of SDK tools.
     
  27. Bhanusrimattey

    Bhanusrimattey

    Joined:
    Sep 29, 2018
    Posts:
    2
    I have same error when i tried to import appcoinspurchasing plugin in the project.Please help me
     
  28. Bhanusrimattey

    Bhanusrimattey

    Joined:
    Sep 29, 2018
    Posts:
    2
    I have same error but removing mainTemplate.gradle file solved the issue.When i import appcoinspurchasing plugin maintemplate.gradle is created and gradle prewarm error reappears.Please help me
     
    Last edited: Apr 23, 2019
  29. Shmoji

    Shmoji

    Joined:
    Nov 16, 2017
    Posts:
    14
    I struggled and struggled with this issue and this is what finally helped solve the error for me

     
    monark and nmbryant like this.
  30. wawo00

    wawo00

    Joined:
    Mar 12, 2018
    Posts:
    1
  31. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    How are your best people getting on with this, it's now October and using 2018.4.10 it's still happening.

    Tried everything above and nothing worked for me.
     
  32. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @monark maybe it's your setup which is special/doesn't work. We haven't heard of this issue for ages. I've also recently removed the warmup from all platforms but Windows Editor.
     
  33. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
  34. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    Try to update android studio, it worked for me
     
  35. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Sadly I can't compile direct from Unity so I have no choice. I've had to go back to using the internal system and just building apks :(
     
  36. wyu0102

    wyu0102

    Joined:
    Feb 12, 2019
    Posts:
    1
    Try to update android studio,and make sure that all FileName of the Unity project path is named in English.
     
  37. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Yup updated android studio several times, and yes 100% English names.
     
  38. mygourabunity

    mygourabunity

    Joined:
    Nov 9, 2016
    Posts:
    4
    I am having the same problem the project was running smooth before then I opened another project which occurs the problem but now the same problem is happening in all projects which were running smooth and error free previously. Please give me some solutions I have tried all the possible things mentioned in the blog. Thank you.