Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 578
[Xamarin.Android.Build.Tasks] warn XA0149 on legacy __AndroidEnvironment__ resources#11700
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| title: .NET for Android warning XA0149 | ||
| description: XA0149 warning code | ||
| ms.date: 06/18/2026 | ||
| f1_keywords: | ||
| - "XA0149" | ||
| --- | ||
| # .NET for Android warning XA0149 | ||
| ## Example messages | ||
| > warning XA0149: Ignoring legacy Xamarin.Android environment file '__AndroidEnvironment__abc123' from NuGet package 'Some.Old.Package' version '1.2.3' in assembly '/path/to/Some.Old.Package.dll'. Environment files from Xamarin.Android class libraries are not supported in .NET for Android. Use a newer version of this NuGet package or notify the library author. | ||
| > warning XA0149: Ignoring legacy Xamarin.Android environment file '__AndroidEnvironment__abc123' in assembly '/path/to/SomeLibrary.dll'. Environment files from Xamarin.Android class libraries are not supported in .NET for Android. Use a newer version of this assembly or notify the library author. | ||
| ## Issue | ||
| A referenced assembly (typically from an older Xamarin.Android class | ||
| library or a NuGet package targeting `MonoAndroid`) contains an embedded | ||
| `__AndroidEnvironment__*` resource. .NET for Android does not consume | ||
| environment files contributed by class libraries via this legacy | ||
| mechanism, so the file is being ignored. | ||
| This is closely related to the | ||
| [NU1703](https://learn.microsoft.com/nuget/reference/errors-and-warnings/nu1703) | ||
| warning that NuGet emits for packages still targeting the deprecated | ||
| `MonoAndroid` framework. | ||
| ## Solution | ||
| Update to a version of the NuGet package or library that targets | ||
| `net-android` (.NET for Android). If you maintain the library, rebuild | ||
| it as a .NET for Android class library so that any environment variables | ||
| are produced in the supported `.net/env/` AAR layout. | ||
| If the environment variables are required by your application, declare | ||
| them directly in your app project using an `@(AndroidEnvironment)` | ||
| item: | ||
| ```xml | ||
| <ItemGroup> | ||
| <AndroidEnvironment Include="env.txt" /> | ||
| </ItemGroup> | ||
| ``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.