You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java source file set build-action "AndoidJavaSource" in project causes compile error #8698
[regression]
VS2022 Ver.17.8.4 with .net8.0-android34.0 project
Java sources within project those which build-action set to "AndroidJavaSource" causes compile error.
After cleaning the solution or project, the build is successfully, and success to deploy package into device, too.
And .cs files(callable-wrapper files) are generated in /obj/Debug/net8.0-android34.0/generated/src/, but IDE continue to indicate CS0246 error and so on.
After change the source , build is fault with error and files in generated/src are deleted.
We add generated .cs files to the project , IDE's error is disapeared, but build failed with dupulicate definition error.
After all we need to clean→build every time to debug the source.
How can I add Java source code to a project without getting an error?
When I tried it, a compile error occurred, but I was able to deploy it.
However, this option prevents to detect the change code with "build". After all, I have to "rebuild" and compile all the code every time to deploy.
Is this spec?
yes, Intellisense is not working at all, even if *.cs exists in object/.../generated folder or not.
And the generated *.cs files are disappeared when build after rebuild even if DisableFastUpToDateCheck is true or not.
yes, Intellisense is not working at all, even if *.cs exists in object/.../generated folder or not. And the generated *.cs files are disappeared when build after rebuild even if DisableFastUpToDateCheck is true or not.
One of our targets is not running during the Intellisense build. I thought we had fixed that.....
It looks like the Install target is deleting the .cs files, I'm going to be looking at that next week.
Activity
StudioLMZa commentedon Feb 8, 2024
This is the bug?
Is interoperability between C# and Java impossible at the source code level?
dellis1972 commentedon Feb 8, 2024
Do you have a sample which demonstrates the issue?
StudioLMZa commentedon Feb 8, 2024
This is the sample to reproduce.

AndroidApp2.zip
dellis1972 commentedon Feb 8, 2024
@StudioLMZa
I suspect you are hitting the same issue as #8658.
Can you try adding the following to the first PropertyGroup in your csproj.
See if that helps. Alternatively in Visual Studio goto
Tools | Options | Projects and Solutions | SDK-Style Projects
and disable the "Up to Date Checks".
StudioLMZa commentedon Feb 9, 2024
When I tried it, a compile error occurred, but I was able to deploy it.
However, this option prevents to detect the change code with "build". After all, I have to "rebuild" and compile all the code every time to deploy.
Is this spec?
dellis1972 commentedon Feb 9, 2024
ok, so its Intellisense which is not working.
StudioLMZa commentedon Feb 9, 2024
yes, Intellisense is not working at all, even if *.cs exists in object/.../generated folder or not.
And the generated *.cs files are disappeared when build after rebuild even if DisableFastUpToDateCheck is true or not.
dellis1972 commentedon Feb 9, 2024
One of our targets is not running during the Intellisense build. I thought we had fixed that.....
It looks like the
Installtarget is deleting the .cs files, I'm going to be looking at that next week.StudioLMZa commentedon Feb 21, 2024
Has there been any progress about this issue?
dellis1972 commentedon Feb 21, 2024
This PR is working on the issue #8706
StudioLMZa commentedon Feb 21, 2024
Thank you for the information.
Add test for Binding Projects
[Xamarin.Android.Build.Tasks] DTBs should not rm generator output (do…
[Xamarin.Android.Build.Tasks] DTBs should not rm generator output
[Xamarin.Android.Build.Tasks] DTBs should not rm generator output (#8835