Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity 2018.2.3f1 build issue with Gradle and GoogleAIDL

Discussion in 'Editor & General Support' started by xenonmiii, Aug 22, 2018.

  1. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    Hi,
    Since we've upgraded from Unity 2018.1 to 2018.2 we're having this issue when doing an Android build.

    "A problem occurred evaluating root project 'gradleOut'.
    > Could not find method implementation() for arguments [{name=GoogleAIDL, ext=aar}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler."

    Now GoogleAIDL.aar has Android selected as the supported platforms.
    I also updated Unity IAP Purchasing from 1.20 to 1.21 but still have the same issue.

    Any tips how to solve this issue?
     
    Last edited: Aug 23, 2018
  2. Biggix

    Biggix

    Joined:
    Dec 8, 2014
    Posts:
    44
    Same issue here. So tired of having broken build with each Unity update!
     
  3. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    I also tried on a Windows machine instead of a Mac, and I'm getting a similar error but different aar mentioned:

    "Could not find method implementation() for arguments [{name=animated-vector-drawable-23.4.0, ext=aar}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler."
     
  4. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    Reverting the project to Unity 2018.1.9f2 builds fine
     
  5. ciligameAnd

    ciligameAnd

    Joined:
    May 30, 2018
    Posts:
    1
    oh````me too,how to fix it?
     
  6. thefuture

    thefuture

    Joined:
    Feb 7, 2014
    Posts:
    3
    Getting the same error here. Moving down to 2018.1.9f2 did in fact compile. This is using Unity Cloud Build.
     
  7. nilareguy

    nilareguy

    Joined:
    Oct 25, 2016
    Posts:
    3
    We were having this issue as well, we had to update our mainTemplate.gradle to reflect the changes they made in the default Unity gradle file. After that, the build was working as intended.
     
    Last edited: Oct 10, 2018
    EyalBira likes this.
  8. EyalBira

    EyalBira

    Joined:
    Jan 30, 2015
    Posts:
    9
    This was the fix for me as well.

    How to solve?
    An easy fix would be to let unity autogenerate the
    mainTemplate.gradle
    file for you, and then applying your changes on the new file.

    1) Copy the current contents of
    Assets/Plugins/Android/mainTemplate.gradle
    file.
    (Or simply have source control to show you the diff)
    2) Delete the
    Assets/Plugins/Android/mainTemplate.gradle
    file.
    3) In the Android Player Settings window -> Publishing Settings: Check the "Custom Gradle Template". That will generate a new
    mainTemplate.gradle
    file for you.
    4) Compare new file with the old one - and apply changes you need to the new file.
     
    PRodi_, BigToe and harrywl3 like this.