jbowmanp1107 / ImageCropper.Maui

MIT License
39 stars 10 forks source link

Exception during android build #22

Closed Alex-Dobrynin closed 4 weeks ago

Alex-Dobrynin commented 1 month ago

I'm building .net 8 android.

Severity    Code    Description Project File    Line    Suppression State
Error   JAVA0000    Error in d:\Nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class:
Type androidx.collection.ArrayMapKt is defined multiple times: d:\Nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, d:\Nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: d:\Nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar
androidx/collection/ArrayMapKt.class
    at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135)
    at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: d:\Nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class
    at Version.fakeStackEntry(Version_8.2.33.java:0)
    at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)
    at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82)
    at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32)
    at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31)
    at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2)
    at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42)
    at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13)
    at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40)
    at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122)
    ... 1 more
Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times: d:\Nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, d:\Nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class
    at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21)
    at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54)
    at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10)
    at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
    at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)
    at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)
    at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61)
    at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12)
    at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9)
    at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45)
    at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17)
    at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69)
    at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28)
    ... 6 more
    OMS     1   
jbowmanp1107 commented 1 month ago

hmm... I am not seeing this locally when building for Android..

Can you try and manually add xamarin.androidx.collection.ktx 1.4.0.1 nuget to your project?

You shouldn't need to, as I don't have this locally.. but I saw something similar before with the ImageCropper,Maui project, as there was some transitive dependency issue..

Alex-Dobrynin commented 1 month ago

yes, that did help. please update Com.Vanniktech.AndroidImageCropper.Maui package to include xamarin.androidx.collection.ktx

jbowmanp1107 commented 4 weeks ago

This has been addressed in v1.1.0.7.