marcojak / MTAdmob

Admob plugin for Xamarin Android and iOS
https://www.xamarinexpert.it/admob-made-easy/
160 stars 26 forks source link

Exception when deploying a project with code shrinker 'r8' enabled #82

Closed potnoddle closed 1 year ago

potnoddle commented 2 years ago

When trying to deploy a build with code shrinker enabled and MTSAdmod installed it fails with the following errors. Is there any way to fix with without disabling code shrinker. I've enabled multidex and tried to skip linking 'Xamarin.GooglePlayServices.Ads.Lite', without luck.

Java.Lang.RuntimeException Message=Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MobileAdsInitProvider" on path: DexPathList[[zip file "/data/app/9JnxTWQqYdiVLuM95aPgDw==/com.allthingsdeveloped.mixologist-E6CdOBJvC0R3CAxubUr-hw==/base.apk"],nativeLibraryDirectories=[/data/app/9JnxTWQqYdiVLuM95aPgDw==/com.allthingsdeveloped.mixologist-E6CdOBJvC0R3CAxubUr-hw==/lib/arm64, /data/app/~~9JnxTWQqYdiVLuM95aPgDw==/com.allthingsdeveloped.mixologist-E6CdOBJvC0R3CAxubUr-hw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]

I've also tried adding, with limited success, the following meta-data it seemed to work for a while. <meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true"/>

marcojak commented 2 years ago

Hi, I haven't tried to enable the code shrinker in my apps so I never had this problem. I will investigate it, meanwhile if you find a solution, please write it here as it could be useful for other people too.

Thank you

roswer13 commented 2 years ago

Hi guys!

This issues is repeated #58 . I tried to find some answer by modifying the TargetFrameworks of the solution, but I don't quite understand why the project doesn't compile in R8. But most likely it is the configuration done for the solution. When I have some time I will continue to evaluate this point.

Best regards.