dansiegel / Mobile.BuildTools

The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
http://mobilebuildtools.com
MIT License
228 stars 29 forks source link

iOS Emulator - Error loading partial Info.plist template file #284

Open carbon-paulc opened 2 years ago

carbon-paulc commented 2 years ago

Description

After installation of Mobile.BuildTools, when trying to build against a mac (using a windows dev machine) I get the following error:

3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(235,3): error : Error loading partial Info.plist template file 'obj/iPhoneSimulator/Debug/mbt/Info.plist': Could not find a part of the path "/Users/{username}/Library/Caches/Xamarin/mtbs/builds/APPNAME.iOS/7d8514f9c34759c7f37616f2d70c7b61cbf63c6de70aa83105f84d31c20be54b/obj/iPhoneSimulator/Debug/mbt/Info.plist".
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(235,3): error :         

I don't know if I'm missing something or need to set something else up?

Works on Android.

Reproduction Steps

Steps to reproduce the behavior:

  1. Create new Xamarin.Forms app
  2. Install Mobile.BuildTools (leave default buildtools.json)
  3. Set to Debug, Simulator
  4. Build

Expected Behavior

Buidl succeeds

Actual Behavior

Build fails. Detailed log shows:

Target "_CompileAppManifest" in file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.Shared.targets" from project "{path to csproj}" (target "_CreateAppBundle" depends on it):
3>Building target "_CompileAppManifest" completely.
3>Output file "bin\iPhoneSimulator\Debug\APPNAME.iOS.app\Info.plist" does not exist.
3>Using "CompileAppManifest" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\..\iOS\Xamarin.iOS.Tasks.dll".
3>Task "CompileAppManifest"
3>  CompileAppManifest: 2021-08-11T10:50:36.8795591+01:00 - Started
3>  CompileAppManifest: 2021-08-11T10:50:36.8795591+01:00 - Initializing
3>  [xma]: Trying to get a Build Connection for Session '7d8514f9c34759c7f37616f2d70c7b61cbf63c6de70aa83105f84d31c20be54b': Xamarin.Messaging.Build.Client.BuildConnection.7d8514f9c34759c7f37616f2d70c7b61cbf63c6de70aa83105f84d31c20be54b, Lifetime: AppDomain
3>  CompileAppManifest: 2021-08-11T10:50:36.8795591+01:00 - Initialized
3>  CompileAppManifest: 2021-08-11T10:50:36.8795591+01:00 - There's no available inputs to copy to the Mac
3>  CompileAppManifest: 2021-08-11T10:50:36.8795591+01:00 - Serializing intputs
3>  CompileAppManifest: 2021-08-11T10:50:36.8895601+01:00 - Executing
3>  [xma]: Starting remote task execution for 'APPNAME.iOS': Xamarin.iOS.Tasks.CompileAppManifest
3>  [xma]: Sending Request Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic xvs/build/execute-task/APPNAME.iOS/7d8514f002fCompileAppManifest
3>  [xma]: Received Response of Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic build7d8514f9c34759c7f37616f2d70c7b61cbf63c6de70aa83105f84d31c20be54b1124{redact}/+/xvs/build/execute-task/APPNAME.iOS/7d8514f002fCompileAppManifest
3>  CompileAppManifest: 2021-08-11T10:50:36.9125598+01:00 - Logging messages
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(235,3): error : Error loading partial Info.plist template file 'obj/iPhoneSimulator/Debug/mbt/Info.plist': Could not find a part of the path "/Users/{username}/Library/Caches/Xamarin/mtbs/builds/APPNAME.iOS/7d8514f9c34759c7f37616f2d70c7b61cbf63c6de70aa83105f84d31c20be54b/obj/iPhoneSimulator/Debug/mbt/Info.plist".
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(235,3): error :         
3>  CompileAppManifest: 2021-08-11T10:50:36.9125598+01:00 - Finished
3>Done executing task "CompileAppManifest" -- FAILED.
3>Done building target "_CompileAppManifest" in project "APPNAME.iOS.csproj" -- FAILED.
3>
3>Build FAILED.

Environment

Reproduction App

Can supply, but can just use the template that ships with VS2019 and installing Mobile.BuildTools nuget

varyamereon commented 2 years ago

I was experiencing the same, setting everything I wasn't using explicitly to disabled in buildtools.json enabled me to build again for iOS. Not sure which part exactly was causing the problem, the only feature I am using is "appSettings".

carbon-paulc commented 2 years ago

@varyamereon Ditto with the appsettings. Just tried this (well all of the ones that appeared in the automatic file) and it didn't work. Would it be possible to check your buildtools.json file to see if there's anything missing? My file below if it helps:

{
    "$schema": "https://mobilebuildtools.com/schemas/v2/buildtools.schema.json",
    "appSettings": {
        "Journey": [
            {
                "properties": [
                    {
                        "name": "ClientId",
                        "type": "String"
                    },
                    {
                        "name": "ClientSecret",
                        "type": "String"
                    }
                ]
            }
        ]
    },
    "appConfig": {
        "strategy": "TransformOnly",
        "disable": true
    },
    "artifactCopy": {
        "disable": true
    },
    "automaticVersioning": {
        "behavior": "PreferBuildNumber",
        "environment": "All",
        "versionOffset": 0,
        "disable": true
    },
    "css": {
        "minify": false,
        "bundleScss": false,
        "disable": true
    },
    "images": {
        "directories": [],
        "conditionalDirectories": {
            "Debug": [],
            "!Debug": [],
            "iOS": [],
            "Android": []
        },
        "disable": true
    },
    "manifests": {
        "token": "$",
        "variablePrefix": "Manifest_",
        "missingTokensAsErrors": false,
        "disable": true
    },
    "releaseNotes": {
        "maxDays": 7,
        "maxCommit": 10,
        "characterLimit": 250,
        "filename": "ReleaseNotes.txt",
        "createInRoot": false,
        "disable": true
    },
    "environment": {
        "defaults": {},
        "configuration": {
            "Debug": {}
        },
        "disable": true
    },
    "debug": false
}
varyamereon commented 2 years ago

Here is mine:

{
  "$schema": "https://mobilebuildtools.com/schemas/v2/buildtools.schema.json",
  "appConfig": {
    "disable": true
  },
  "artifactCopy": {
    "disable": true
  },
  "automaticVersioning": {
    "behavior": "Off"
  },
  "css": {
    "disable": true
  },
  "images": {
    "disable": true
  },
  "manifests": {
    "disable": true
  },
  "appSettings": {
    "AppName": [
      {
        "accessibility": "Internal",
        "className": "AppSettings",
        "delimiter": ";",
        "namespace": ".",
        "rootNamespace": null,
        "properties": [
          {
             // properties
          }
        ]
      }
    ]
  },
  "releaseNotes": {
    "disable": true
  },
  "debug": false
}

Difference I spotted was I set automatic versioning behavior to off and I don't have a setting for environment.

Hope it helps.

carbon-paulc commented 2 years ago

That worked! Tempted to remove bits one by one to see what caused it but thats for another day.

Not surw whether I should close this or leave it as a bug?

ondrejnovotny commented 2 years ago

This problem disappears when you disable

"manifests": { "token": "$", "variablePrefix": "Manifest_", "missingTokensAsErrors": true, "disable": true
}