Mobile.BuildTools
Mobile.BuildTools copied to clipboard
Android project not referencing values in AppSettings.g.cs file
Description
A clear and concise description of what the bug is.
I'm currently using Mobile.BuildTools to generate my AppSettings file with secrets pulled from various appsettings.[ENVIRONMENT_NAME].json
files (e.g. appsettings.dev.json
, appsettings.stage.json
, and appsettings.prod.json
). During the build process for both iOS and Android, the AppSettings.g.cs
file is created and placed into the expected location. After the application builds, iOS utilizes the values set in the file, but Android does not - the values are seen as null. However, looking at the AppSettings.g.cs
file, the values are what I expect them to be (my secrets, as pulled from the above JSON files)
Reproduction Steps
Steps to reproduce the behavior:
- Create an application with Mobile.BuildTools
- Create
appsettings.json
files for various environments - Update build config to match those environments (e.g. add a
Dev
,Stage
, andProd
build config - Build the Android project
Expected Behavior
Properties set in AppSettings.g.cs
are utilized in the application
Actual Behavior
Properties set in AppSettings.g.cs
are returning null only for Android applications - iOS builds as expected.
Environment
- OS: [macOS 11.6 (Big Sur)]
- IDE: [JetBrains Rider & VSMac]
- BuildTools Version: [2.0.245]
- IDE Version:
- JetBrains Rider: 2021.2.1
- VSMac: 2019 (8.10.10, Build 8)
- Build Target Framework: [Xamarin.Android]
Reproduction App
Please include a sample app that reproduces the issue and/or a binlog. Failure to reproduce either of these may lead to the issue being closed or ignored.
I am unable to provide a sample app, but have included the build log for the Xamarin.Android project. MobileBuildTools_BuildLog_2021-12-21.txt