Search Unity

2017.3 New Gradle Error

Discussion in 'Editor & General Support' started by Ebonicus, Mar 18, 2018.

  1. Ebonicus

    Ebonicus

    Joined:
    Oct 31, 2016
    Posts:
    158
    Hello,

    I had a project requiring updates to some SDKs, so I installed some SDKS in Android studio for this app.

    Another app that was building fine, is now showing gradle errors and will NOT build with teh gradle option, previously worked fine.
    It will build using internal, but I do not know why I am getting these gradle errors on build now.

    > Failed to find Build Tools revision 28.0.0

    I have no idea how to install build tools 28. There is nothing of the sort available in Android studio.

    Here is the error stack.




    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_111\bin\java.exe -classpath "C:\Program Files\Unity2017\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.

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

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

    BUILD FAILED in 1s
    ]
    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)
     
    Lagn likes this.
  2. DJ-Coco

    DJ-Coco

    Joined:
    Apr 27, 2014
    Posts:
    47
    Do you have the Android SDK Manager installed?
    You should be able to download any Build Tools version from there.

    I don't use Android Studio, but I think updating the Build Tools should also be possible from within there.
     
  3. Ebonicus

    Ebonicus

    Joined:
    Oct 31, 2016
    Posts:
    158
    Build Tools 28 does exist in Android studio.
    For the SDK, it is listed as P, and was not installed.
    So, I did notice that the if the build tools for 28 exists on your system, and the actual SDK for 28 does not exist, this error occurs.

    So, I removed all build tools down to 26, so my highest build tools is 26 and my highest sdk is 26. That fixed this error.

    This was caused by Google Admob asset package installing the build tools up to 28, without installing the SDK, I think this happened when I ran the Android resolver.
     
    Lagn and oikumo like this.
  4. Lilush99

    Lilush99

    Joined:
    Sep 17, 2017
    Posts:
    1
    Thank u so much Ebonicus!!!!
    i wasted so much time on this error.
     
  5. Ebonicus

    Ebonicus

    Joined:
    Oct 31, 2016
    Posts:
    158
    My pleasure, glad I could help, I am fairly new.
     
  6. tiledmediadev

    tiledmediadev

    Joined:
    May 15, 2018
    Posts:
    2
    Ran into the same issue on 2017.3.0f1 after installing SDK 28.

    For me the workaround was to copy ./mips64el-linux-android-4.9/ from android-ndk-r13b/toolchains/ to (AndroidSdkFolder)/ndk-bundle/toolchains/

    A bit more info can be found here: https://github.com/google/filament/issues/15
     
    _legolas_ likes this.
  7. scarofsky

    scarofsky

    Joined:
    Sep 29, 2016
    Posts:
    11
    thx for saving me from that.
     
  8. Ebonicus

    Ebonicus

    Joined:
    Oct 31, 2016
    Posts:
    158
    Glad I could help somebody!
     
  9. _legolas_

    _legolas_

    Joined:
    Nov 10, 2014
    Posts:
    12