googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.38k stars 1.08k forks source link

Can't resolve dependencies with new GMA 9.4.0 #3692

Closed madTeddy closed 13 hours ago

madTeddy commented 1 week ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

When trying to get dependencies via External Dependency Manager, I see an error:

Execution failed for task ':process_androidx.annotation.annotation-experimental-1.4.0.aar'.
> Unsupported class file major version 61

With GMA 9.3.0 I don't have this problem.

vinkini commented 1 week ago

Hello,

The unsupported class file is due to mismatch in the Java version used by the Unity Editor and the the Java version used to compile the annotation-experimental-1.4.0.aar binary. I was able to resolve this on my end by letting Gradle do the dependency management instead of External Dependency Manager. Here are ths steps I followed:

  1. Turn on "Patch mainTemplate.gradle" in Assets > External Dependency Manager > Android Resolver > Settings image
  2. Delete Previously downloaded libraries. Assets > External Dependency Manager > Android Resolver > Delete Resolved Libraries. [If this doesn't end up deleting all the resolved libraries in Assets > Plugins > Android, then you might have to manually delete the libraries].
  3. Assets > External Dependency Manager > Android Resolver > Force Resolve. This step now shouldnt pull any of the libraries but insteads fixes the gradle files to include the necessary libraries. Gradle does the dependency management henceforth.

Let us know if this works for you. In the mean time we will investigate what changed to cause this issue to pop up in 9.4.0 and not in the version before.

madTeddy commented 1 week ago

Hello,

The unsupported class file is due to mismatch in the Java version used by the Unity Editor and the the Java version used to compile the annotation-experimental-1.4.0.aar binary. I was able to resolve this on my end by letting Gradle do the dependency management instead of External Dependency Manager. Here are ths steps I followed:

  1. Turn on "Patch mainTemplate.gradle" in Assets > External Dependency Manager > Android Resolver > Settings image
  2. Delete Previously downloaded libraries. Assets > External Dependency Manager > Android Resolver > Delete Resolved Libraries. [If this doesn't end up deleting all the resolved libraries in Assets > Plugins > Android, then you might have to manually delete the libraries].
  3. Assets > External Dependency Manager > Android Resolver > Force Resolve. This step now shouldnt pull any of the libraries but insteads fixes the gradle files to include the necessary libraries. Gradle does the dependency management henceforth.

Let us know if this works for you. In the mean time we will investigate what changed to cause this issue to pop up in 9.4.0 and not in the version before.

I turned off Patch mainTemplate.gradle, because with it, I can't build a project with the Google Play Games v11 plugin... So I guess if this is the only solution, I will stay on version 9.3.0 for now.

vinkini commented 1 week ago

Thanks for letting us know. We will take a look into it. In the mean time 9.3.0 sounds good. If you need to upgrade the underlying Android and iOS SDKs you can manually update the Assets > GoogleMobileAds > Editor > GoogleMobileAdsDependencies.xml file to point to 11.12 for iOS and 23.5.0 for Android.