Have current VS 2019
Have File in Android App Project with BuildAction "AndroidEnvironment"
e.g. a file with the name "environment.txt" (content:
MONO_LOG_LEVEL=error
)
Do a Release Archive Build -> Final APK does not contain an "environment" file
Archived APK should contain a environment file, with the content from the environment.txt File (the one with the build Action "AndroidEnvironment") + extra content (in my case this with VS 2017 15.9.11):
mono.llvm=true
mono.aot=normal
## Source File: environment.txt
MONO_LOG_LEVEL=error
XAMARIN_BUILD_ID=43ae6be2-ebf2-43ae-9878-51086f52f896
XA_HTTP_CLIENT_HANDLER_TYPE=Xamarin.Android.Net.AndroidClientHandler
XA_TLS_PROVIDER=btls
MONO_GC_PARAMS=major=marksweep-conc
)
environment file is missing in the final APK
App is crashing sigsev 11 directly after launch
Microsoft Visual Studio Enterprise 2019 Version 16.1.1
Xamarin.Android SDK 9.3.0.22 (HEAD/8e7764fdf)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/2018-08@3cb36842fc4
Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
LibZipSharp: grendello/LibZipSharp/d16-1@44de300
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26
I have the same issue.
It works ok with VS2017 and Xamarin.Android 9.1.7.0
Does not work with VS2019 and Xamarin.Android 9.3.0.22
Same issue. Tried renaming file, changing file location, and UNIX encoding.
The only solution was using VS2017.
I am experiencing what looks to be the same issue.
File named "env.conf" has AndroidEnvironment" Build Action with "Do Not Copy" for Copy to Output Directory. Tried "Copy Always" doesn't make it appear either.
Microsoft Visual Studio Professional 2019
Version 16.1.1
VisualStudio.16.Release/16.1.1+28922.388
Microsoft .NET Framework
Version 4.7.03190
Installed Version: Professional
Application Insights Tools for Visual Studio Package 9.1.00429.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2019 16.1.429.50124
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 16.1.429.50124
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.1.429.50124
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 16.1.429.50124
Azure Functions and Web Jobs Tools
C# Tools 3.1.0-beta4-19266-03+9d80dea7fe1b14043b9b2ac4d0b59ed26f508742
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.1.77 (master@24013d5)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
GorillaPlayerPackage Extension 1.0
GorillaPlayerPackage Visual Studio Extension Detailed Info
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20419.2
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 1.0
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Mono Debugging for Visual Studio 16.1.1 (2473f22)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.1.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info
SQL Server Data Tools 16.0.61904.23160
Microsoft SQL Server Data Tools
TypeScript Tools 16.0.10506.2004
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.1.0-beta4-19266-03+9d80dea7fe1b14043b9b2ac4d0b59ed26f508742
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.4 for F# 4.6 16.1.0-beta.19253.3+42526fe359672a05fd562dc16a91a43d0fe047a7
Microsoft Visual F# Tools 10.4 for F# 4.6
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
Xamarin 16.1.0.542 (d16-1@68b985244)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.1.0.418 (remotes/origin/d16-1@5b958bb10)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.2.112 (4db4af4)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 9.3.0.22 (HEAD/8e7764fdf)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/2018-08@3cb36842fc4
Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
LibZipSharp: grendello/LibZipSharp/d16-1@44de300
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26
Xamarin.iOS and Xamarin.Mac SDK 12.10.0.153 (750a879)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Archived APK should contain a environment file, with the content from the environment.txt File
This isn't the case anymore, environment variables are now emitted into native assembly code that can quickly apply them on startup. They are embedded in libxamarin-app.so.
See: https://github.com/xamarin/xamarin-android/pull/2718
What is the specific problem this causes? Does MONO_GC_PARAMS not work anymore? If so, we should look into this.
If your app is relying on this environment.txt file directly, should you use AndroidAsset or a raw AndroidResource instead?
/cc @grendello
Let us know if there is a problem here, and we can look into this more, thanks!
Most helpful comment
I have the same issue.
It works ok with VS2017 and Xamarin.Android 9.1.7.0
Does not work with VS2019 and Xamarin.Android 9.3.0.22