0

While migrating a Xamarin.Forms app into .NET MAUI and fixing different issues, I'm getting "Type android.support.v4.app.INotificationSideChannel$Stub$Proxy is defined multiple times" from my Android part of the solution:

Error JAVA0000 in obj\Debug\net8.0-android\lp\144\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub$Proxy.class:
Type android.support.v4.app.INotificationSideChannel$Stub$Proxy is defined multiple times: obj\Debug\net8.0-android\lp\144\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub$Proxy.class, obj\Debug\net8.0-android\lp\29\jl\bin\classes.jar:android/support/v4/app/INotificationSideChannel$Stub$Proxy.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net8.0-android\lp\144\jl\classes.jar
android/support/v4/app/INotificationSideChannel$Stub$Proxy.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: obj\Debug\net8.0-android\lp\144\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub$Proxy.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 android.support.v4.app.INotificationSideChannel$Stub$Proxy is defined multiple times: obj\Debug\net8.0-android\lp\144\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub$Proxy.class, obj\Debug\net8.0-android\lp\29\jl\bin\classes.jar:android/support/v4/app/INotificationSideChannel$Stub$Proxy.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
Directory 'obj\Debug\net8.0-android\lp\144' is from 'androidx.core.core.aar'.

The package references from the Android project:

<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.0.0" />
<PackageReference Include="Controls.UserDialogs.Maui" Version="1.5.4" />
<PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
<PackageReference Include="Syncfusion.Maui.Core" Version="26.1.38" />
<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.9.0.3" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.3" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.0.5" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.4" />
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.2" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.26" />
<PackageReference Include="Xamarin.Azure.NotificationHubs.Android" Version="1.1.4.1" />
<PackageReference Include="Xamarin.Google.Dagger" Version="2.50.0" />
<PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.4.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.60" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.60" />

I have previously fixed multiple AndroidX related issues with explicit dependencies in the project file already, but this does not seem related to them.

5
  • Have a look at the latest packages here Commented Jun 19, 2024 at 18:49
  • I have added the package reference in your both this and last question in different new maui project. I didn't get any error and can build successfully. Did you try to close the VS and delete the obj folder then rebuild it? Commented Jun 20, 2024 at 3:39
  • In addition, you can remove all the packages about xamarin android and then add them one by one to check which package cause this error. Commented Jun 20, 2024 at 5:54
  • Yes, I've previously tried closing VS, deleting build output, and running dotnet restore and dotnet build without success. Won't I just get the previous errors instead? Commented Jun 20, 2024 at 13:15
  • You can have a try because I can't reproduce your problem. Those packages worked well in new maui project. Commented Jun 21, 2024 at 5:50

1 Answer 1

0

The only way I managed to recover from this error was to clone the Visual Studio solution code, from bitbucket repository that I was working from. I started in a brand new folder. The only thing I was missing was a few lines of code from the day I'd been working on it.

This worked for me and was a quicker solution that all the others I've read and should save hours/days of searching for a answer to this problem.

Hope this helps others.

Sign up to request clarification or add additional context in comments.

1 Comment

Since this I've got the same error back so maybe not the right solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.