[Xamarin.Android.Build.Tasks] Unable to use import androidx.appcompat.widget.Toolbar into a java file when using AndroidJavaSource#8194
Merged
jonpryor merged 2 commits intodotnet:mainfrom Sep 21, 2023
Conversation
5c6f6fa to
f195e91
Compare
Member
jonathanpeppers
left a comment
There was a problem hiding this comment.
Should we add a test? I guess it could be an app with one *.java file using an AndroidX type?
Contributor
Author
Done :) |
jonathanpeppers
approved these changes
Jul 24, 2023
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
….widget.Toolbar into a java file when using AndroidJavaSource Fixes dotnet#8191 TODO
jonathanpeppers
approved these changes
Sep 21, 2023
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Sep 22, 2023
* main: [Xamarin.Android.Build.Tasks] Add `RunWithLogging` target (dotnet#8324) [Xamarin.Android.Build.Tasks] AndroidJavaSource refs dependent jars (dotnet#8194) Bump to xamarin/Java.Interop/main@75d8221 (dotnet#8336) Bump NDK to r26 (dotnet#8213)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8191
The implementation of
AndroidJavaSourcewas missing one component. It was missing references to theclasses.jarfiles which are extracted to the$(IntemediateOutputPath)lpdirectory. As a result we end up witherrors such as the following
What was missing was a dependency on the
_GetLibraryImportstarget. This target will call the chain oftargets which extracts the dependent
classes.jarfiles and populates the@(Jars)ItemGroup which is used in the_CompileBindingJavatarget. This should allow users to write simple wrapper methods in Java that wrap morecomplex API.