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

iOS Emulator - Error loading partial Info.plist template file

Open carbon-paulc opened this issue 3 years ago • 5 comments

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

  • OS: Windows 10
  • IDE: V22019
  • BuildTools Version: 2.0.245
  • IDE Version: 16.10.4
  • Build Target Framework: Xamarin.iOS

Reproduction App

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

carbon-paulc avatar Aug 11 '21 11:08 carbon-paulc

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".

varyamereon avatar Aug 12 '21 14:08 varyamereon

@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
}

carbon-paulc avatar Aug 16 '21 09:08 carbon-paulc

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.

varyamereon avatar Aug 16 '21 09:08 varyamereon

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?

carbon-paulc avatar Aug 16 '21 09:08 carbon-paulc

This problem disappears when you disable

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

ondrejnovotny avatar Sep 20 '21 12:09 ondrejnovotny