marcojak / MauiMTAdmob

MIT License
104 stars 17 forks source link

Type is defined multiple times build issue #34

Open Noobicle opened 1 year ago

Noobicle commented 1 year ago

Hello,

I've been using your xamarin plugin for a long time and really liked the simplicity so thank you. Since moving to MAUI I've found your work to be helpful yet again!

I'm trying to use this plugin in combination with https://github.com/TobiasBuchholz/Plugin.Firebase specifically the crashalytics(works fine) and the analytics. After installing the analytics plugin if MauiMTAdmob is also installed it causes the following crash;

Error in obj\Debug\net7.0-android33.0\lp\233\jl\classes.jar:com/google/android/gms/internal/measurement/zzef.class:
Type com.google.android.gms.internal.measurement.zzef is defined multiple times: obj\Debug\net7.0-android33.0\lp\233\jl\classes.jar:com/google/android/gms/internal/measurement/zzef.class, obj\Debug\net7.0-android33.0\lp\261\jl\classes.jar:com/google/android/gms/internal/measurement/zzef.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net7.0-android33.0\lp\233\jl\classes.jar
com/google/android/gms/internal/measurement/zzef.class
    at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:98)
    at com.android.tools.r8.D8.main(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net7.0-android33.0\lp\233\jl\classes.jar:com/google/android/gms/internal/measurement/zzef.class
    at Version.fakeStackEntry(Version_3.3.75.java:0)
<Removed>

Directory 'obj\Debug\net7.0-android33.0\lp\233' is from 'play-services-measurement-sdk-api.aar'.

I've found the conflict appears to be between the Admob plugin and the Plugin.firebase.analytics

I've tried googling to no avail do you have any recommendation on how I can fix this?

I'm quite new to MAUI/Xamarin so please forgive me if it's a really obvious solution.

Simple minimum repo; https://github.com/Noobicle/MauiBuildErrorMin

EdwardMcFlurry commented 11 months ago

I'm also facing the same ISSUE as Android cannot finish the build at all. Anyone who can help?

Noobicle commented 11 months ago

Sadly I haven't found a solution yet.

I've reverted to using appcenter until I can go back and try to fix.

marcojak commented 11 months ago

I don't use that library so I'm not sure yet. I'm having a look right now and I'll see if there is anything I can do to solve this.

EdwardMcFlurry commented 11 months ago

@marcojak please look into it as I got iOS to work perfectly but struggling to build Android as it fails

dsuny commented 11 months ago

You can use version 1.0.1.

EdwardMcFlurry commented 11 months ago

@dsuny what do you mean v1.0.1 when there's v1.0.4?

eyeveye commented 10 months ago

Try using 1.0.2

marcojak commented 4 months ago

Can you try with the latest version of the plugin?