Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve AndroidToolTask Error Reporting #7009

Closed
jonpryor opened this issue May 17, 2022 · 2 comments · Fixed by #7012
Closed

Improve AndroidToolTask Error Reporting #7009

jonpryor opened this issue May 17, 2022 · 2 comments · Fixed by #7012
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@jonpryor
Copy link
Member

Android application type

Classic Xamarin.Android (MonoAndroid12.0, etc.), Android for .NET (net6.0-android, etc.)

Affected platform version

All

Description

Context: https://developercommunity.visualstudio.com/t/Android-does-not-compile-R8-Could-not-c/10041869
Context: https://discord.com/channels/732297728826277939/732297837953679412/976106729123242034
Context? https://developercommunity.visualstudio.com/t/Xamarin-Forms-Android-project-will-not-b/10038789
Context: …

The ideal error message lets you know what went wrong in such a fashion that you can fix it.

This is not ideal:

1>R8 : error : Could not create the Java Virtual Machine.
1>R8 : error : A fatal exception has occurred. Program will exit.

Nor is this:

/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.300-rc.3.45/tools/Xamarin.Android.D8.targets(5,5): Error: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net6.0-android/lp/63/jl/classes.jar : android/support/v4/app/INotificationSideChannel$Stub.class (WearOSNet6Test)

Nor is this:

Xamarin.Android.Common.targets: … error MSB6006: “java.exe” exited with code 1

We should do better.

"Guiding principal": if we need to ask someone for a diagnostic build log to understand a problem, we have failed. We must do better.

At minimum, we should update AndroidToolTask (and others) so that all output, stdout & stderr, is collected. When an error occurs, all output should be re-printed as part of the error message. (We currently attempt to do this in JavaToolTask, but it's clearly not doing enough. We need to improve JavaToolTask/etc. & do that everywhere.)

Additionally, we need to "demangle" our paths. Consider: https://discord.com/channels/732297728826277939/732297837953679412/976109392413990982

here's the problem

Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net6.0-android/lp/63/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net6.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class

Where do obj/Debug/net6.0-android/lp/4/jl/bin/classes.jar:android and obj/Debug/net6.0-android/lp/63/classes.jar come from?

We know that we can use obj/Debug/net6.0-android/lp/map.cache to associate 4 with "something in lines 3-6 in map.cache" (yay off-by-one errors), but this isn't particularly helpful; it requires additional "back and forth" between the customer experiencing the error and us, trying to help the customer.

Instead, we should print additional error output, informing that obj/Debug/net6.0-android/lp/4 is from e.g. Xamarin.Android.Support.Annotations.dll, and obj/Debug/net6.0-android/63 is from e.g. androidx.core.core.aar.

This "demangling" should be done for all error messages, including "non-Java" tools such as aapt2.

Steps to Reproduce

Consider #7003:

  1. Download WearOSNet6Test.zip

  2. Extract it:

    unzip WearOSNet6Test.zip
    cd WearOSNet6Test
    
  3. Build it:

    dotnet build
    

Actual output:

C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.300-rc.1.4\tools\Xamarin.Android.D8.targets(79,5): error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net6.0-android31\lp\59\jl\classes.jar : android/support/v4/app/INotificationSideChannel$Stub.class [C:\Users\jopryo\Downloads\WearOSNet6Test\WearOSNet6Test.csproj]

Desired output: something more useful?

error XA0000: Error in obj\Debug\net6.0-android31\lp\59\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class: (TaskId:207)
error XA0000: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj\Debug\net6.0-android31\lp\59\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj\Debug\net6.0-android31\lp\4\jl\bin\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class (TaskId:207)
error XA0000: Compilation failed (TaskId:207)
error XA0000: Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net6.0-android31\lp\59\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.a(SourceFile:92) (TaskId:207)
error XA0000: 	at com.android.tools.r8.D8.main(D8.java:4) (TaskId:207)
error XA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net6.0-android31\lp\59\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class (TaskId:207)
error XA0000: 	at Version.fakeStackEntry(Version_3.1.51.java:0) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.a(SourceFile:68) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.a(SourceFile:28) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.a(SourceFile:27) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.b(SourceFile:3) (TaskId:207)
error XA0000: 	at com.android.tools.r8.D8.a(D8.java:17) (TaskId:207)
error XA0000: 	at com.android.tools.r8.D8.a(D8.java:15) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.a(SourceFile:84) (TaskId:207)
error XA0000: 	... 1 more (TaskId:207)
error XA0000: Caused by: com.android.tools.r8.internal.b: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj\Debug\net6.0-android31\lp\59\jl\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj\Debug\net6.0-android31\lp\4\jl\bin\classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.il1.a(SourceFile:14) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.il1.a(SourceFile:22) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.lf1.b(SourceFile:6) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.lf1.a(SourceFile:23) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.lf1.a(SourceFile:10) (TaskId:207)
error XA0000: 	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.lf1.a(SourceFile:6) (TaskId:207)
error XA0000: 	at com.android.tools.r8.graph.r2$a.f(SourceFile:4) (TaskId:207)
error XA0000: 	at com.android.tools.r8.dex.b.a(SourceFile:96) (TaskId:207)
error XA0000: 	at com.android.tools.r8.dex.b.a(SourceFile:21) (TaskId:207)
error XA0000: 	at com.android.tools.r8.D8.a(D8.java:21) (TaskId:207)
error XA0000: 	at com.android.tools.r8.D8.d(D8.java:11) (TaskId:207)
error XA0000: 	at com.android.tools.r8.D8.c(D8.java:1) (TaskId:207)
error XA0000: 	at com.android.tools.r8.internal.oO0.a(SourceFile:24) (TaskId:207)
error XA0000: 	... 5 more (TaskId:207)
error XA0000: Directory `obj\Debug\net6.0-android31\lp\59` is from `androidx.core.core.aar`
error XA0000: Directory `obj\Debug\net6.0-android31\lp\4` is from `Xamarin.Android.Support.Compat.dll`

Did you find any workaround?

Collect diagnostic build output / .binlog files.

Everybody does that, right? Right?

(Narrator: no, not everybody does that.)

Relevant log output

No response

@jonpryor jonpryor added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels May 17, 2022
@dellis1972 dellis1972 removed the needs-triage Issues that need to be assigned. label May 18, 2022
@jpobst
Copy link
Contributor

jpobst commented May 18, 2022

Related: #6380

@jonpryor
Copy link
Member Author

…and another: https://discord.com/channels/732297728826277939/732297837953679412/978456435279155260

javac error JAVAC0000:  error: package com.plugin.pluginstreaminglibrary does not exist

dellis1972 added a commit to dellis1972/xamarin-android that referenced this issue Jun 6, 2022
Fixes: dotnet#7009

Context: xamarin/monodroid@b60c77f

Let's create a `java`-related error message!

 1. Create an `android` app:

        dotnet new -n bad_error

 2. Edit `bad_error.csproj` to change
    `$(SupportedOSPlatformVersion)`=23, and add this item group:

        <ItemGroup>
          <PackageReference Include="Xamarin.AndroidX.Wear" Version="1.2.0.5" />
          <PackageReference Include="Xamarin.Android.Wear" Version="2.2.0" />
          <PackageReference Include="Xamarin.AndroidX.PercentLayout" Version="1.0.0.14" />
          <PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI" Version="1.0.0.14" />
        </ItemGroup>

 3. Build

        dotnet build bad_error/bad_error.csproj

It should fail to build:

	error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException:
	Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar :
	android/support/v4/app/INotificationSideChannel$Stub.class

It is expected to fail.  The problem is that *why* it fails is
opaque, and thus it's very hard to know what the problem is so that
it can be fixed.

If you rebuild with diagnostic logging enabled:

	dotnet build -v diag bad_error/bad_error.csproj

We get additional, *useful*, contextual information:

	Task "D8"
	  Task Parameter:JavaMaximumHeapSize=1G
	  Task Parameter:OutputDirectory=obj/Debug/net7.0-android/android/bin/
	  Task Parameter:
	      JavaLibrariesToEmbed=
	          …/dotnet/packs/Microsoft.Android.Ref.32/33.0.0-preview.4.20/ref/net7.0/mono.android.jar
	          …
	  Task Parameter:JarPath=…/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.0-preview.4.20/tools/r8.jar
	  …
	    processing ClassesZip, JavaLibrariesToEmbed...
	  $HOME/android-toolchain/jdk-11/bin/java -Xmx1G -classpath …/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.0-preview.4.20/tools/r8.jar com.android.tools.r8.D8 --debug --min-api 23 --output obj/Debug/net7.0-android/android/bin/ …
	  Error in obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class:
	  Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  Compilation failed
	  Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
	  	at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
	  Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  	at Version.fakeStackEntry(Version_3.3.28.java:0)
	  	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
	  	…
	  Caused by: com.android.tools.r8.internal.f: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  	at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
	  	…

*Now* we see what the error is:

	Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times:

The fundamental problem is that this entire process is "broken": we
shouldn't require that the project be rebuilt with diagnostic logging
enabled in order to *begin* to understand what the error was.

Part of why the original error message was so "unhelpful" was because
of an explicit attempt to produce a more "helpful" message; from
xamarin/monodroid@b60c77fe

> we need to pick out the exception and then ignore the rest of the
> infromation [sic]. We also need to produce more 'helpful' messages
> to the user for these kind of exceptions.

In retrospect, attempting to "trim out extraneous information" was a
mistake, as it's very hard to know what is and isn't extraneous.

Improve `<JavaToolTask/>` so that we go the other way: capture *all*
output from `java`, and when an error is detected, dump out all the
output from the `java` command.  This way, instead of:

	error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: …

we can provide a more complete error message *without* needing to
enable diagnostic logs:

	  error XA1234: Error in obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class:
	  error XA1234: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error XA1234: Compilation failed
	  error XA1234: Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error XA1234: 	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
	  error XA1234: 	at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
	  error XA1234: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error XA1234: 	at Version.fakeStackEntry(Version_3.3.28.java:0)
	  error XA1234: 	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
	  error XA1234: 	…
	  error XA1234: Caused by: com.android.tools.r8.internal.f: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error XA1234: 	at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
	  error XA1234: 	…

Unfortunately, this error message is still cryptic: what does
`obj/Debug/net7.0-android/lp/59/jl/classes.jar` come from?
What about `obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar`?

At the end of the full `java` output, dump a mapping of the
encountered `…/lp/…` paths to where they came from:

	error XA1234: Directory `obj/Debug/net7.0-android/lp/59` is from `androidx.interpolator.interpolator.aar`
	error XA1234: Directory `obj/Debug/net7.0-android/lp/4` is from `Xamarin.Android.Support.Compat.dll`
jonpryor pushed a commit that referenced this issue Jun 7, 2022
Fixes: #7009

Context: xamarin/monodroid@b60c77f

Let's create a `java`-related error message!

 1. Create an `android` app:

        dotnet new -n bad_error

 2. Edit `bad_error.csproj` to change
    `$(SupportedOSPlatformVersion)`=23, and add this item group:

        <ItemGroup>
          <PackageReference Include="Xamarin.AndroidX.Wear" Version="1.2.0.5" />
          <PackageReference Include="Xamarin.Android.Wear" Version="2.2.0" />
          <PackageReference Include="Xamarin.AndroidX.PercentLayout" Version="1.0.0.14" />
          <PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI" Version="1.0.0.14" />
        </ItemGroup>

 3. Build

        dotnet build bad_error/bad_error.csproj

It should fail to build:

	error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException:
	Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar :
	android/support/v4/app/INotificationSideChannel$Stub.class

It is expected to fail.  The problem is that *why* it fails is
opaque, and thus it's very hard to know what the problem is so that
it can be fixed.

If you rebuild with diagnostic logging enabled:

	dotnet build -v diag bad_error/bad_error.csproj

We get additional, *useful*, contextual information:

	Task "D8"
	  Task Parameter:JavaMaximumHeapSize=1G
	  Task Parameter:OutputDirectory=obj/Debug/net7.0-android/android/bin/
	  Task Parameter:
	      JavaLibrariesToEmbed=
	          …/dotnet/packs/Microsoft.Android.Ref.32/33.0.0-preview.4.20/ref/net7.0/mono.android.jar
	          …
	  Task Parameter:JarPath=…/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.0-preview.4.20/tools/r8.jar
	  …
	    processing ClassesZip, JavaLibrariesToEmbed...
	  $HOME/android-toolchain/jdk-11/bin/java -Xmx1G -classpath …/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.0-preview.4.20/tools/r8.jar com.android.tools.r8.D8 --debug --min-api 23 --output obj/Debug/net7.0-android/android/bin/ …
	  Error in obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class:
	  Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  Compilation failed
	  Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
	  	at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
	  Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  	at Version.fakeStackEntry(Version_3.3.28.java:0)
	  	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
	  	…
	  Caused by: com.android.tools.r8.internal.f: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  	at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
	  	…

*Now* we see what the error is:

	Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times:

The fundamental problem is that this entire process is "broken": we
shouldn't require that the project be rebuilt with diagnostic logging
enabled in order to *begin* to understand what the error was.

Part of why the original error message was so "unhelpful" was because
of an explicit attempt to produce a more "helpful" message; from
xamarin/monodroid@b60c77fe

> we need to pick out the exception and then ignore the rest of the
> infromation [sic]. We also need to produce more 'helpful' messages
> to the user for these kind of exceptions. 

In retrospect, attempting to "trim out extraneous information" was a
mistake, as it's very hard to know what is and isn't extraneous.

Improve `<JavaToolTask/>` so that we go the other way: capture *all*
output from `java`, and when an error is detected, dump out all the
output from the `java` command.  This way, instead of:

	error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: …

we can provide a more complete error message *without* needing to
enable diagnostic logs:

	  error JAVA0000: Error in obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class:
	  error JAVA0000: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error JAVA0000: Compilation failed
	  error JAVA0000: Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error JAVA0000: 	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
	  error JAVA0000: 	at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
	  error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error JAVA0000: 	at Version.fakeStackEntry(Version_3.3.28.java:0)
	  error JAVA0000: 	at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
	  error JAVA0000: 	…
	  error JAVA0000: Caused by: com.android.tools.r8.internal.f: Type android.support.v4.app.INotificationSideChannel$Stub is defined multiple times: obj/Debug/net7.0-android/lp/59/jl/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class, obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar:android/support/v4/app/INotificationSideChannel$Stub.class
	  error JAVA0000: 	at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
	  error JAVA0000: 	…

Unfortunately, this error message is still cryptic: what does
`obj/Debug/net7.0-android/lp/59/jl/classes.jar` come from?
What about `obj/Debug/net7.0-android/lp/4/jl/bin/classes.jar`?

At the end of the full `java` output, dump a mapping of the
encountered `…/lp/…` paths to where they came from:

	error JAVA0000: Directory `obj/Debug/net7.0-android/lp/59` is from `androidx.interpolator.interpolator.aar`
	error JAVA0000: Directory `obj/Debug/net7.0-android/lp/4` is from `Xamarin.Android.Support.Compat.dll`
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants