Home > Enterprise >  Error building android: Duplicate class androidx.annotation.AnimRes found in modules annotation-1.3.
Error building android: Duplicate class androidx.annotation.AnimRes found in modules annotation-1.3.

Time:07-13

So when I try to build android app, I get these duplicate errors and also warnings about mapping new ns.

enter image description here

I tried many different configuration and sdks etc. For now my setup is:

  1. Unity 2019.4.40f1
  2. Android SDK, JDK and NDK downloaded as a modules from unity hub (I tried different ones, nothing changes)
  3. Gradle 6.9.2 (already tried the latest one version, still same)

My target api is level 30 and minimum is 21.

I am using many libraries for my project like Branch.io for deeplinks, playfab, googleplayservices, facebook sdk etc. It might be the issue, but I am not sure.

I tried also export my project and it works surprisingly.

Also what's important I use custom gradle.properties file which looks like that:

enter image description here

CodePudding user response:

Finally, I solved this by deleting old jars located in gradles templates location, for me: Assets>Plugins>Android

  • Related