Skip to content

Conversation

@dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Aug 11, 2017

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58721

The initial problem seems to stem from the fact that for the
support library components now directly include the resources.
As a result the _GenerateJavaResourcesForComponent was not
running. This was because it was only running if
_AdditonalAndroidResourceCachePaths was not empty.
In this scenario it was always empty.

As a result none of the files like R.java files were generated
for the support libraries. The means the final .class files
did not have references for the R$drawable.foo identifiers.
This results in a crash.

So to fix the problem we need to start looking at the
@(LibraryResourceDirectories) to see if we have any
AndroidManifest.xml files. We should then process these
directories to ensure that the R.java files are created.
The finally compiled into the final applications.

… CheeseSquare sample

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58721

The initial problem seems to stem from the fact that for the
support library components now directly include the resources.
As a result the `_GenerateJavaResourcesForComponent` was not
running. This was because it was only running if
`_AdditonalAndroidResourceCachePaths` was not empty.
In this scenario it was always empty.

As a result none of the files like R.java files were generated
for the support libraries. The means the final .class files
did not have references for the R$drawable.foo identifiers.
This results in a crash.

So to fix the problem we need to start looking at the
`@(LibraryResourceDirectories)` to see if we have any
AndroidManifest.xml files. We should then process these
directories to ensure that the R.java files are created.
The finally compiled into the final applications.
@dellis1972 dellis1972 removed the do-not-merge PR should not be merged. label Aug 14, 2017
@jonpryor jonpryor merged commit 2e73aea into dotnet:master Aug 14, 2017
jonpryor pushed a commit that referenced this pull request Aug 14, 2017
)

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58721

The initial problem seems to stem from the fact that for the support
library components now directly include the resources. As a result
the `_GenerateJavaResourcesForComponent` target was not running. This
was because it was only running if
`$(_AdditonalAndroidResourceCachePaths)` was not empty. In this
scenario it was always empty.

As a result none of the files like `R.java` files were generated for
the support libraries. The means the final `.class` files did not
have references for the `R$drawable.foo` identifiers.

This results in a crash:

	Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$drawable;

Fix the problem by looking at `@(LibraryResourceDirectories)` to see
if we have any `AndroidManifest.xml` files. We should then process
these directories to ensure that the `R.java` files are created and
included compiled into the final applications.
jonpryor pushed a commit that referenced this pull request Nov 11, 2020
Fixes: #5251

Context: dotnet/java-interop@99897b2

Changes: dotnet/java-interop@c3c3575...99897b2

  * dotnet/java-interop@99897b24: [jcw-gen] Do not register static methods on an interface. (#745)
  * dotnet/java-interop@54ba3c33: [.JavaSource, .ApiXmlAdjuster] Use Nullable Reference Types (#746)
  * dotnet/java-interop@b588ef50: [java-source-utils] Add response file support (#744)

Adds a test for `static` methods on an interface that is implemented
by a class.  Our existing `static` test was an interface that only
contained `static` members, and thus we did not try to implement the
interface.

Implementing the interface exposed a JCW error.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 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.

3 participants