-
Notifications
You must be signed in to change notification settings - Fork 204
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
There is no AndroidResource build action in Maui #1500
Comments
Hi @plequere-ms There is an AndroidResource build action: I think the issue here is that the text wasn't fully updated in the move from Xamarin.Essentials to .NET MAUI. What currently says "Create a new XML file named auto_backup_rules.xml in the Resources/xml directory..." should be "Create a new XML file named auto_backup_rules.xml in the Platforms/Android/Resources/xml directory..." |
Hi @davidbritch. I don't see this option. I also checked colors.xml and the properties are as follows: They're default properties. The settings in colors.xml do work. |
Hi @plequere-ms I just created a new MAUI project in 17.6.1 and looked at the build actions available on colors.xml. There are multiple Android* properties, which is what I'd expect: |
To clarify, AndroidResource was already set as the build action on colors.xml. |
Okay, I got to the bottom of this. The AndroidResource Build Action only shows up if the project targets Android in a generic manner:
It does not show up if I target a specific version, such as:
Is this a bug or a feature? |
It's a known issue (whether it's a bug or feature is debatable), which is why it gets no mentions in the docs. When you use |
@plequere-ms After discussing this internally, it's apparently a bug that needs logging on Developer Community. |
This bug is worse than just specifying a particular version of Android. In my project, if I use:
I see several Android-specific build actions (AndroidAsset, AndroidBoundLayout, AndroidNativeLibrary, AndroidResource, AndroidAotProfile, AndroidGradleProject, ...). However, if I swap it so that Android is not the first item:
Suddenly, all of those Android-specific build actions vanish and the files in Platforms\Android\Resources all get a build action of None. |
Additionally, all of the tooling for Android platform-specific files, like the UI builder for Android layouts, was unavailable unless net9.0-android was listed first. |
The "Selective Backup" section appears to have been copied and pasted from the old Xamarin docs. There is no AndroidResource build action in Maui. The build action should be left as None.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 92649
The text was updated successfully, but these errors were encountered: