Gradle build failed (META-INF/com.android.tools/proguard/coroutines.pro)

Hi everyone,
We’ve spent a whole week trying to solve this and we haven’t been able to make it work.
In order to update one of our games, we need to target api level 33 or beyod (as everyone has to), but when building a test apk, our devices with android 12+ cannot install the game. They get an “invalid package” error. Upon further investigation, we found that in order to target an api level of 31+ activities and services must have the android:exported atribute set to true but one of our plugins (Firebase) sets that value to false in the manifest. The thing is that we were using an old version of the plugin that no matter what we do, the package is always invalid for devices with android 12+. So we went and updated the FIrebase plugin version to see if we could work with the latest and we found out we cannot build anymore.
We get the following error:

stderr[
Note: C:\Some_folder\Project_root_folder\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:transformResourcesWithMergeJavaResForRelease'.
> More than one file was found with OS independent path 'META-INF/com.android.tools/proguard/coroutines.pro'

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

* Get more help at https://help.gradle.org

BUILD FAILED in 32s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]

We have found some posts with other similar errors but none with the coroutines.pro and most of them just suggesto to add an ignorefor that path, but so far it hasn’t worked with us.
Is there a way of knowing where that path is being referenced and delete it?

Thanks in advance.

[UPDATE]
After several tests (and tickets with Firebase support) we found a few issues:

  • There is an incompatibility between Firebase v11.3.0 packages when imported in Unity Editor v2019.4.8f1(LTS)
  • Unity Editor v2019.4.8f1 (LTS) cannot build a valid android apk for Target API level 33 (even with an empty project).

We are updating our project to Unity Editor v2021 because we have been able to build valid apk tests (even with Firebase packages).

Hi @Cuicui_Studios , let us know how the process of upgrading the project to Unity v2021.3 goes, and if it solves your issue.

So far, after updating to Unity v2021.3.10f1 we are able to generate a valid test apk of our project that can be installed and launched on devices with OS Android 12+ (we haven’t tried an aab for the store yet tho).
We have some runtime issues, but they seem to be from our app (or the interaction with the new version of the packages).

Unity Editor v2021.3.10f1(LTS) can generate valid apk that target api level 33.