dotnet / dotnet/android-libraries

Google Play Age Signals – R8 Duplicate Class Errors (androidx.tracing + androidx.savedstate) in Xamarin/Android Binding

Open
#1,332 8 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
C#
Stars
317
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
17

Description

### Description

We are integrating the Google Play Age Signals API (package: com.google.android.play:age-signals) using the official Xamarin binding package ‘Xamarin.Google.Android.Play.Age.Signals (0.0.1-beta02)’.

During R8/D8 compilation, the build fails with duplicate class errors:

Duplicate class: androidx.tracing.TraceKt$traceAsync$1 - tracing-android.aar - tracing-ktx.aar

Duplicate class: androidx.savedstate.ViewKt - savedstate-android.aar - savedstate-ktx.aar

This occurs even when:

Explicitly pinning AndroidX versions
Excluding tracing/savedstate dependencies
Adding ProGuard rules
Using in NuGet
The issue appears to originate from the Age Signals AAR pulling mismatched AndroidX dependencies (ktx + non-ktx) that produce conflicting classes.

We cannot integrate Age Signals into production until this is resolved.

Request:

Please verify the dependency structure for com.google.android.play:age-signals
Update the AAR to depend consistently on either android or ktx variants
Provide guidance for R8/D8 linking with Age Signals
Environment:

.NET 9 Android
R8 8.7.x
Xamarin.AndroidX.* stable versions
Xamarin.Google.Android.Play.Age.Signals 0.0.1-beta02
Thank you.

### Steps to Reproduce

_No response_

### Link to public reproduction project repository

_No response_

### Version with bug

10.0.20

### Is this a regression from previous behavior?

No, this is something new

### Last version that worked well

Unknown/Other

### Affected platforms

Android

### Affected platform versions

_No response_

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.