googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 337 forks source link

[Bug] Execution failed for task ':launcher:checkReleaseDuplicateClasses'. #626

Closed MariuszJendrzejczak closed 11 months ago

MariuszJendrzejczak commented 11 months ago

[READ] For Firebase Unity SDK issues, please report to Firebase Unity Sample

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

Uploading Google Mobile Ads from 7.3.1 -> 8.3.0 Build the project.

Please answer the following, if applicable:

I moved my old project from Unity 2020 to 2022. And that was working fine with little adjustment. But to handle RODO masagers (that will be required in the future by Google Play Store) I tried to update Google Mobile Ads plugin, to newest. For the one that provides Google User Messaging Platform 2.0.0 inside.

And after that upload I get error when I try to build my project (see above). I tried to removieng plugins External Dep Manager -> Andorid -> Remove, than Resolve again and it not work. When I tried to remove duplicated arr. files manually, I could make the build, but it not working at all. I also tried to follow similar isues logs form StackOvesflov or Github, but it leads me to nowhere.

I am using Firaebase plugins in this project as well, but it seems that FB is not an issue on this.

CommandInvokationFailure: Gradle build failed. E:\UnityEditors\2022.3.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "E:\UnityEditors\2022.3.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables: HOMEPATH = \Users\jendr USERDOMAIN = DESKTOP-RAUTJ32 ProgramFiles = C:\Program Files TMP = C:\Users\jendr\AppData\Local\Temp PROCESSOR_ARCHITECTURE = AMD64 PROCESSOR_REVISION = 3c03 OneDriveConsumer = C:\Users\jendr\OneDrive OS = Windows_NT CHROME_CRASHPAD_PIPE_NAME = \.\pipe\crashpad_32272_KLZCCHTMXXQUBGNZ PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 60 Stepping 3, GenuineIntel AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa USERPROFILE = C:\Users\jendr JAVA_HOME = E:\UnityEditors\2022.3.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK CommonProgramFiles = C:\Program Files\Common Files DriverData = C:\Windows\System32\Drivers\DriverData ComSpec = C:\WINDOWS\system32\cmd.exe LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283 PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\ PUBLIC = C:\Users\Public SystemRoot = C:\WINDOWS HEAP_CLIENT_TOKEN = 1717415662 NUMBER_OF_PROCESSORS = 4 WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3 JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8 DEBUG_ENV_VAR = UnityHub ProgramW6432 = C:\Program Files FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer TEMP = C:\Users\jendr\AppData\Local\Temp Path = C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\AdoptOpenJDK\jdk-11.0.8.10-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Inkscape\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\SourceGear\Common\DiffMerge\;C:\MinGW\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\PuTTY\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git LFS;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Users\jendr\AppData\Local\Microsoft\WindowsApps;C:\Users\jendr\AppData\Local\Programs\Microsoft VS Code\bin;C:\MinGW\bin;C:\Users\jendr.dotnet\tools;C:\Program Files\Azure Data Studio\bin;C:\Program Files (x86)\BrowserStackLocal\;C:\Program Files\JetBrains\PyCharm 2022.3.1\bin;;C:\Program Files\mitmproxy\bin;G:\scr\flutter\flutter\bin; USERNAME = jendr COMPUTERNAME = DESKTOP-RAUTJ32 USERDOMAIN_ROAMINGPROFILE = DESKTOP-RAUTJ32 PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC SystemDrive = C: ALLUSERSPROFILE = C:\ProgramData SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017 HEAP_CLIENT_TOKEN_STAGING = 3786794399 PyCharm = C:\Program Files\JetBrains\PyCharm 2022.3.1\bin; ProgramData = C:\ProgramData FPS_BROWSER_USER_PROFILE_STRING = Default windir = C:\WINDOWS AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21 CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files APPDATA = C:\Users\jendr\AppData\Roaming PROCESSOR_LEVEL = 6 CommonProgramW6432 = C:\Program Files\Common Files ProgramFiles(x86) = C:\Program Files (x86) SESSIONNAME = Console GIT_LFS_PATH = C:\Program Files\Git LFS LOGONSERVER = \DESKTOP-RAUTJ32 LOCALAPPDATA = C:\Users\jendr\AppData\Local VBOX_MSI_INSTALL_PATH = J:\VirtualBox\ LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282 HOMEDRIVE = C: OneDrive = C:\Users\jendr\OneDrive VS160COMCOMNTOOLS = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\ ORIGINAL_XDG_CURRENT_DESKTOP = undefined

stderr[ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

paulinon commented 11 months ago

HI @MariuszJendrzejczak,

Thanks for reporting this issue. In order to identify what's causing this, could you provide a minimal, reproducible example of your project along with the complete steps to replicate this behavior?

chkuang-g commented 11 months ago

Hi @MariuszJendrzejczak

Duplicate class androidx.lifecycle.LifecycleRegistry found in modules androidx.lifecycle.lifecycle-runtime-2.1.0-runtime (:androidx.lifecycle.lifecycle-runtime-2.1.0:) and androidx.lifecycle.lifecycle-runtime-2.4.1-runtime (:androidx.lifecycle.lifecycle-runtime-2.4.1:)

Quick questions: Did you enabled Custom Main Gradle Template and Custom Gradle Properties Template? If not, I remember Unity 2023 did add certain support libraries in their base Gradle project which could conflict with the libraries downloaded by EDM4U. The best solution is to enabled Custom Main Gradle Template and Custom Gradle Properties Template in Player Settings and let Unity handle the resolution.

I would not be surprised if the backport this change to 2022.3...

Please let us know. Shawn

MariuszJendrzejczak commented 11 months ago

No, I didn't, enabled CMGT and CGPT. For now, a solution that I found was, to make a completely new project in Unity. Add Firebase plugin, Google Mobile Ads Plugin, Advanced Input Field 2 Plugin and then prepare the unity package with all assets used in the previews project. Add that package, and in this new project, everything works fine. So I assume, that was something making a mess hidden in the previews project (I wasn't the original creator of it), or Unity mess up with something when I moved it from between 2020 and 2022.

Abbabon commented 11 months ago

We had the same issue cropping up in two of our projects - one upgraded from Unity 2020.3 to 2022.3, and another one built from the ground up in 2022.3.

Both of the projects are built for the .aab format, with the 'Split Application Binary' setting turned on and required (due to the file's size reaching 200MB).

We have both the latest Facebook SDK (16.0.1), Firebase SDKs (11.2.0), as well as Unity's IAP setting turned on (from digging around at various github issues threads I gather it has some significance).

Abbabon commented 11 months ago

Another clue I have is this:

This dependencies error crops up while resolving dependencies in the project:

WARNING: Some conflicting dependencies were found.
The following dependency versions were modified:
com.android.support:appcompat-v7:25.3.1 --> androidx.appcompat:appcompat:1.0.0
com.android.support:cardview-v7:25.3.1 --> androidx.cardview:cardview:1.0.0
com.android.support:customtabs:25.3.1 --> androidx.browser:browser:1.0.0
com.android.support:support-v4:25.3.1 --> androidx.legacy:legacy-support-v4:1.0.0

This is the error that fails the build:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules core-1.0.0-runtime (androidx.core:core:1.0.0) and jetified-androidx.core.core-1.3.2-runtime (:androidx.core.core-1.3.2:)
     Duplicate class android.support.v4.media.MediaBrowserCompat found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$CallbackHandler found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback$ConnectionCallbackInternal found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback$StubApi21 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$CustomActionCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$CustomActionResultReceiver found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ItemCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ItemCallback$StubApi23 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ItemReceiver found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImpl found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$1 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$2 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$3 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$4 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$5 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$6 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$7 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi23 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi26 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$1 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$2 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$3 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$4 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$5 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$6 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$MediaServiceConnection found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$MediaServiceConnection$1 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$MediaServiceConnection$2 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserServiceCallbackImpl found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaItem found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaItem$1 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$MediaItem$Flags found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$SearchCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$SearchResultReceiver found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ServiceBinderWrapper found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$Subscription found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$SubscriptionCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$SubscriptionCallback$StubApi21 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompat$SubscriptionCallback$StubApi26 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi21 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi21$ConnectionCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi21$ConnectionCallbackProxy found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi21$MediaItem found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi21$SubscriptionCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi21$SubscriptionCallbackProxy found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi23 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi23$ItemCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi23$ItemCallbackProxy found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi26 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi26$SubscriptionCallback found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaBrowserCompatApi26$SubscriptionCallbackProxy found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompat found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompat$1 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompat$Builder found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompatApi21 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompatApi21$Builder found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompatApi23 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaDescriptionCompatApi23$Builder found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat$1 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat$BitmapKey found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat$Builder found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat$LongKey found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat$RatingKey found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompat$TextKey found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-runtime (androidx.media:media:1.0.0)
     Duplicate class android.support.v4.media.MediaMetadataCompatApi21 found in modules jetified-androidx.media.media-1.0.0-runtime (:androidx.media.media-1.0.0:) and media-1.0.0-r<message truncated>
Abbabon commented 11 months ago

All relevant templates are enabled (and untinkered with btw)

image

Abbabon commented 11 months ago

@MariuszJendrzejczak, Writing to let you know I managed to solve the issue.

I disabled all custom gradle-related templates and then proceeded to delete them from Assets/Plugins/Android (when disabling these files they are not deleted, but instead renamed with a .DISABLED suffix.

It was smooth sailing from there - I used Delete Resolved Libraries, resolved again, and the files were populated correctly with the correct settings.

MariuszJendrzejczak commented 11 months ago

@Abbabon Your solution doesn't work for me.

And my solution frome above was also only a temporary solution, becouse, when I made new projeckt and import everything pice by pice, I was able to make 3-4 build without errors, but after those, the problem comes back. Unity engine or resolver updates something in temporary files (becouse I couldn't see any changes in git repo), and I am stuck again.

I tryed to move to newest recomended 2022.3.5f1 engine, but this also not solving anything.

MariuszJendrzejczak commented 11 months ago

Found it! @Abbabon it turns out, that your solution was fine for me too, but with little adjustment. After removing resolved libs, there was few of them still in the plugins/android folder. So I had to remove it manually and then hit Resolve. I removed everything from the folder except FirebaseApp, FirebaseCrashlytics, googlemobileads-unity, GoogleMobileAdsPlugin.

chkuang-g commented 11 months ago

@Abbabon When you see duplicate class in android.support and androidx, it usually means the Jetifier is not enabled. Please check the Android Resolver settings under Asset > External Dependency Manager > Android Resolver > Settings. I remember I changed Jetifier to be enabled by default in EDM4U recently. This may explain why a fresh project actually works for you.

@MariuszJendrzejczak I think the remaining Android libraries under Assets/Plugins/Android folder should be the cause. Clean them up and use Custom Main Gradle Template should be the way to go.

I'll close this thread for now. Please open a new ticket if the problem still occurs.