Skip to content

Conversation

jonathanpeppers
Copy link
Member

Fixes: #5627

In some cases, Android Studio projects can produce .aar files that
contain:

libs/r-classes.jar

Reviewing the contents of one of these r-classes.jar files:

com/test/R.class

It appears they are potentially moving any R.java files into this
new r-classes.jar file.

So if you have two .aar files that contain a r-classes.jar in a
Xamarin.Android application, you would currently run into the error:

JAR library references with identical file names but different contents were found: r-classes.jar.
Please remove any conflicting libraries from EmbeddedJar, InputJar and AndroidJavaLibrary.

We should make the <CheckDuplicateJavaLibraries/> MSBuild task
ignore this issue for r-classes.jar. I can't find any good links to
explain this new file, or why it exists.

I added a test for this scenario.

Fixes: dotnet#5627

In some cases, Android Studio projects can produce `.aar` files that
contain:

    libs/r-classes.jar

Reviewing the contents of one of these `r-classes.jar` files:

    com/test/R.class

It appears they are potentially moving any `R.java` files into this
new `r-classes.jar` file.

So if you have two `.aar` files that contain a `r-classes.jar` in a
Xamarin.Android application, you would currently run into the error:

    JAR library references with identical file names but different contents were found: r-classes.jar.
    Please remove any conflicting libraries from EmbeddedJar, InputJar and AndroidJavaLibrary.

We should make the `<CheckDuplicateJavaLibraries/>` MSBuild task
ignore this issue for `r-classes.jar`. I can't find any good links to
explain this new file, or why it exists.

I added a test for this scenario.
@jonpryor jonpryor merged commit a9ca3d4 into dotnet:master Mar 5, 2021
@jonathanpeppers jonathanpeppers deleted the r-classes.jar branch March 5, 2021 00:24
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflicting libraries when using generated and packed Xamarin.Android Bindings.
2 participants