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-ads Gradle Error

Discussion in 'Editor & General Support' started by Deleted User, Sep 19, 2018.

  1. Deleted User

    Deleted User

    Guest

    Hello. Im having problems wiht unity ads during the build of the project. Few days ago it worked and after something happened. Now i just cant build the project. But if i delete unityads.aar it builds fine. But no ad is working. Ill attach some screenshots of errors.
     

    Attached Files:

    • er.png
      er.png
      File size:
      15.4 KB
      Views:
      873
    • err1.png
      err1.png
      File size:
      3.6 KB
      Views:
      834
    • err2.png
      err2.png
      File size:
      33.3 KB
      Views:
      814
  2. Deleted User

    Deleted User

    Guest

    If im trying ti build it in Android Studio thats the error i get - Multiple dex files define Lcom/unity3d/ads/webview/WebViewApp$WebAppChromeClient;
     
  3. Deleted User

    Deleted User

    Guest

    Welp. In Andorid Studio build.gradle file i found these lines with "unity.ads" aar(see the attached screnshot). If i coment 1 one them i can build the project. Though ads not working after. Any ideas somebody?
     

    Attached Files:

  4. Deleted User

    Deleted User

    Guest

    Ok. since no one replied i will continue talking to myself:D
    Found the solution. In Android Studio gradle.build file just set minifyEnabled true.
    These are the only changes u must do. After it it builds fine.
     

    Attached Files:

    • err5.png
      err5.png
      File size:
      11.9 KB
      Views:
      870
  5. radamedeiros

    radamedeiros

    Joined:
    Jan 8, 2016
    Posts:
    2
    Thanks Dude!
     
  6. Deleted User

    Deleted User

    Guest

    No problem) Glad u found it useful)