There are two errors:1: Task failed with an exception.
-----------
What went wrong:
A problem occurred configuring project ':unityLibrary:GoogleMobileAdsPlugin.androidlib'.
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
Namespace not specified. Specify a namespace in the module's build file: E:\MyPath\Temp\gradleOut\unityLibrary\GoogleMobileAdsPlugin.androidlib\build.gradle. See
https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
2: Task failed with an exception.
-----------
What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@60fab28b of type BuildFlowService.Parameters
A problem occurred configuring project ':unityLibrary:GoogleMobileAdsPlugin.androidlib'.
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
Namespace not specified. Specify a namespace in the module's build file: E:\Mypath\Temp\gradleOut\unityLibrary\GoogleMobileAdsPlugin.androidlib\build.gradle. See
https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
I tried use this link to solve this problem https://developers.google.com/admob/unity/android?hl=zh-cn#2019.4---2021.3.37f1, but I do not find build.gradle underi the "GoogleMobileAdsPlugin.androidlib" folder. If I add one ,there will be many duplicated class error like this:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.unity3d.ads.BuildConfig found in modules UnityAds.aar -> jetified-UnityAds-runtime (:UnityAds:) and unity-ads-4.16.2.aar -> jetified-unity-ads-4.16.2-runtime (com.unity3d.ads:unity-ads:4.16.2)
Duplicate class com.unity3d.ads.IUnityAdsInitializationListener found in modules UnityAds.aar -> jetified-UnityAds-runtime (:UnityAds:) and unity-ads-4.16.2.aar -> jetified-unity-ads-4.16.2-runtime (com.unity3d.ads:unity-ads:4.16.2)
Duplicate class com.unity3d.ads.IUnityAdsLoadListener found in modules UnityAds.aar -> jetified-UnityAds-runtime (:UnityAds:) and unity-ads-4.16.2.aar -> jetified-unity-ads-4.16.2-runtime (com.unity3d.ads:unity-ads:4.16.2)
Duplicate class com.unity3d.ads.IUnityAdsShowListener found in modules UnityAds.aar -> jetified-UnityAds-runtime (:UnityAds:) and unity-ads-4.16.2.aar -> jetified-unity-ads-4.16.2-runtime (com.unity3d.ads:unity-ads:4.16.2)
Duplicate class com.unity3d.ads.IUnityAdsTokenListener found in modules UnityAds.aar -> jetified-UnityAds-runtime (:UnityAds:) and unity-ads-4.16.2.aar -> jetified-unity-ads-4.16.2-runtime (com.unity3d.ads:unity-ads:4.16.2)
Duplicate class com.unity3d.ads.UnityAds found in modules UnityAds.aar -> jetified-UnityAds-runtime (:UnityAds:) and unity-ads-4.16.2.aar -> jetified-unity-ads-4.16.2-runtime (com.unity3d.ads:unity-ads:4.16.2)
How can I solve this problem? Any help will be greatly appreciated!
Thanks in advance for your help.