-
Notifications
You must be signed in to change notification settings - Fork 538
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
Add android:networkSecurityConfig support to ApplicationAttribute #1224
Comments
For future reference, there is nothing related to bindings. It is about MSBuild. |
This should fix dotnet#1224. Those attributes were based on build-tools/manifest-attribute-codegen.exe (which is not really codegen yet, but lists up all the manifest attributes that are found from Android SDK resources). However not all the attributes were documented. For those undocumented attributes, the issue dotnet#1336 was created to track.
This should fix dotnet#1224. Those attributes were based on build-tools/manifest-attribute-codegen.exe (which is not really codegen yet, but lists up all the manifest attributes that are found from Android SDK resources). However not all the attributes were documented. For those undocumented attributes, the issue dotnet#1336 was created to track.
…#1338) Fixes: #1224 Adds support for the `AndroidManifest.xml` element `<uses-configuration/>` via `Android.App.UsesConfigurationAttribute`: partial class UsesConfigurationAttribute { public bool ReqFiveWayNav { get; set; } public bool ReqHardKeyboard { get; set; } public string ReqKeyboardType { get; set; } public string ReqNavigation { get; set; } public string ReqTouchScreen { get; set; } } Updates many existing custom attributes to add support for new `AndroidManifest.xml` element attributes, including: * `Android.App.ActivityAttribute.ColorMode` * `Android.App.ActivityAttribute.MaxAspectRatio` * `Android.App.ActivityAttribute.ShowForAllUsers` * `Android.App.ApplicationAttribute.BackupInForeground` * `Android.App.ApplicationAttribute.FullBackupOnly` * `Android.App.ApplicationAttribute.NetworkSecurityConfig` * `Android.App.ApplicationAttribute.UsesCleartextTraffic` * `Android.App.InstrumentationAttribute.TargetProcesses` * `Android.App.UsesFeatureAttribute.Version` Added attributes were found via `build-tools/manifest-attribute-codegen.exe` (which is not really codegen yet, but lists up all the manifest attributes that are found from Android SDK resources). However, not all the attributes which were found were documented. Undocumented attributes are being tracked at: #1336
I really need this attribute. When will it be publicly available? |
Is there any documentation regarding how to use the attribute? I can see it's publicly available, but when I add it with [Application(NetworkSecurityConfig = "@xml/network_security_config")], the project does not build anymore (error is The "GenerateJavaStubs" task failed unexpectedly). |
@jonpryor Can you please have a look on my previous comment? |
Similar concerns in this issue #2176. There is no apparent workaround to achieve desired results. |
For future reference. If you are working on an Android app, make sure after you add the network_security_config.xml file, you configure the Build Action to AndroidResource in the Property panel. This actually fixed the build error "resource xml/network_security_config (aka com.companyname.ut.sample:xml/network_security_config) not found. UT.Sample" for me. |
Context: #5749 Changes: xamarin/monodroid@5676b84...0156d4e * xamarin/monodroid@0156d4e51: Bump to xamarin/androidtools@ae1f8fbe (#1225) * xamarin/monodroid@33a26e453: Bump to xamarin/android-sdk-installer@98fa41ba (#1224)
Steps to Reproduce
[Application]
attribute and try specifying networkSecurityConfig as a propertyExpected Behavior
Should allow user to specify url/path to the networkSecurityConfig
Actual Behavior
Xamarin.Android does not support specifying this attribute in manifest through property.
Version Information
Latest master https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.NamingCustomAttributes/Android.App/ApplicationAttribute.cs
Log File
N/A
Other
This attribute was included in API 24
https://developer.android.com/guide/topics/manifest/application-element.html#networkSecurityConfig
Looks like it is not yet available via C# surface
The text was updated successfully, but these errors were encountered: