Mobile.BuildTools icon indicating copy to clipboard operation
Mobile.BuildTools copied to clipboard

Android project not referencing values in AppSettings.g.cs file

Open amkuchta opened this issue 3 years ago • 0 comments

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:

  1. Create an application with Mobile.BuildTools
  2. Create appsettings.json files for various environments
  3. Update build config to match those environments (e.g. add a Dev, Stage, and Prod build config
  4. 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

amkuchta avatar Dec 21 '21 14:12 amkuchta