Skip to content

Commit 473aec3

Browse files
authored
Fix duplicate class errors for runtime-annotation-jvm and datastore-preferences-core-jvm (#1371)
Fixes: #1341 Exclude JVM variant packages as runtime dependencies from their parent no-bindings packages to prevent duplicate class errors (JAVA0000) when R8/D8 code shrinker is enabled in Android/MAUI projects. - Xamarin.AndroidX.Compose.Runtime.Annotation (1.10.3.1): exclude androidx.compose.runtime.runtime-annotation-jvm as runtime dependency - Xamarin.AndroidX.DataStore.Preferences.Core (1.2.0.2): exclude androidx.datastore.datastore-preferences-core-jvm as runtime dependency The Maven POMs declare the JVM variant as a compile-scope dependency of the parent artifact. The binderator was converting this into a NuGet PackageReference, causing both the Android (.aar) and JVM (.jar) variants to be included simultaneously, leading to: 'Type androidx.compose.runtime.Immutable is defined multiple times' 'Type androidx.compose.runtime.StableMarker is defined multiple times' 'Type androidx.datastore.preferences.core.AtomicBoolean is defined multiple times'
1 parent 7570c45 commit 473aec3

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@
750750
"groupId": "androidx.compose.runtime",
751751
"version": "1.10.3",
752752
"nuGetId": "Xamarin.AndroidX.Compose.Runtime.Annotation",
753-
"nuGetVersion": "1.10.3"
753+
"nuGetVersion": "1.10.3.1"
754754
}
755755
},
756756
"license": "The Apache Software License, Version 2.0"
@@ -1569,7 +1569,7 @@
15691569
"groupId": "androidx.datastore",
15701570
"version": "1.2.0",
15711571
"nuGetId": "Xamarin.AndroidX.DataStore.Preferences.Core",
1572-
"nuGetVersion": "1.2.0.1"
1572+
"nuGetVersion": "1.2.0.2"
15731573
}
15741574
},
15751575
"license": "The Apache Software License, Version 2.0"

config.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,10 @@
412412
"groupId": "androidx.compose.runtime",
413413
"artifactId": "runtime-annotation",
414414
"version": "1.10.3",
415-
"nugetVersion": "1.10.3",
415+
"nugetVersion": "1.10.3.1",
416416
"nugetId": "Xamarin.AndroidX.Compose.Runtime.Annotation",
417-
"type": "no-bindings"
417+
"type": "no-bindings",
418+
"excludedRuntimeDependencies": "androidx.compose.runtime.runtime-annotation-jvm"
418419
},
419420
{
420421
"groupId": "androidx.compose.runtime",
@@ -859,8 +860,9 @@
859860
"groupId": "androidx.datastore",
860861
"artifactId": "datastore-preferences-core",
861862
"version": "1.2.0",
862-
"nugetVersion": "1.2.0.1",
863-
"nugetId": "Xamarin.AndroidX.DataStore.Preferences.Core"
863+
"nugetVersion": "1.2.0.2",
864+
"nugetId": "Xamarin.AndroidX.DataStore.Preferences.Core",
865+
"excludedRuntimeDependencies": "androidx.datastore.datastore-preferences-core-jvm"
864866
},
865867
{
866868
"groupId": "androidx.datastore",

docs/artifact-list-with-versions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
| 55|androidx.compose.material3:material3-window-size-class-android |1.4.0 |Xamarin.AndroidX.Compose.Material3.WindowSizeClassAndroid |1.4.0.1 |
6363
| 56|androidx.compose.runtime:runtime |1.10.3 |Xamarin.AndroidX.Compose.Runtime |1.10.3 |
6464
| 57|androidx.compose.runtime:runtime-android |1.10.3 |Xamarin.AndroidX.Compose.Runtime.Android |1.10.3 |
65-
| 58|androidx.compose.runtime:runtime-annotation |1.10.3 |Xamarin.AndroidX.Compose.Runtime.Annotation |1.10.3 |
65+
| 58|androidx.compose.runtime:runtime-annotation |1.10.3 |Xamarin.AndroidX.Compose.Runtime.Annotation |1.10.3.1 |
6666
| 59|androidx.compose.runtime:runtime-annotation-android |1.10.3 |Xamarin.AndroidX.Compose.Runtime.Annotation.Android |1.10.3 |
6767
| 60|androidx.compose.runtime:runtime-annotation-jvm |1.10.3 |Xamarin.AndroidX.Compose.Runtime.Annotation.Jvm |1.10.3 |
6868
| 61|androidx.compose.runtime:runtime-livedata |1.10.3 |Xamarin.AndroidX.Compose.Runtime.LiveData |1.10.3 |
@@ -125,7 +125,7 @@
125125
| 118|androidx.datastore:datastore-core-okio-jvm |1.2.0 |Xamarin.AndroidX.DataStore.Core.OkIO.Jvm |1.2.0.1 |
126126
| 119|androidx.datastore:datastore-preferences |1.2.0 |Xamarin.AndroidX.DataStore.Preferences |1.2.0.1 |
127127
| 120|androidx.datastore:datastore-preferences-android |1.2.0 |Xamarin.AndroidX.DataStore.Preferences.Android |1.2.0.1 |
128-
| 121|androidx.datastore:datastore-preferences-core |1.2.0 |Xamarin.AndroidX.DataStore.Preferences.Core |1.2.0.1 |
128+
| 121|androidx.datastore:datastore-preferences-core |1.2.0 |Xamarin.AndroidX.DataStore.Preferences.Core |1.2.0.2 |
129129
| 122|androidx.datastore:datastore-preferences-core-android |1.2.0 |Xamarin.AndroidX.DataStore.Preferences.Core.Android |1.2.0.1 |
130130
| 123|androidx.datastore:datastore-preferences-core-jvm |1.2.0 |Xamarin.AndroidX.DataStore.Preferences.Core.Jvm |1.2.0.1 |
131131
| 124|androidx.datastore:datastore-preferences-external-protobuf |1.2.0 |Xamarin.AndroidX.DataStore.Preferences.External.Protobuf |1.2.0.1 |

0 commit comments

Comments
 (0)