I have a VS 2022 Windows Xamarin Forms application that has been working successfully on Android and UWP. I have started working with a cloud Mac service to build an iOS version. I have tweaked a couple of things the way you do when you are trying to get something new to work, but I don't know what I might have done to cause this. Obviously I know what a basic OutOfRangeException is, but I have no idea how to solve this or even really what to look for.
The problem occurs during the build, not when running my code, so I have no idea where or how to look for the problem.
I tried unloading the iOS project but the error still occurs.
Here is the error
2> KhyberPassWithUWP2.Android -> C:\Users\Charles\source\repos\KhyberPass 2022\KhyberPassWithUWP2.Android\bin\Debug\KhyberPassWithUWP2.Android.dll
2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1683,3): error XAGPM7006: System.IndexOutOfRangeException: Index was outside the bounds of the array.
2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1683,3): error XAGPM7006: at Xamarin.Android.Tasks.GeneratePackageManagerJava.<>c__DisplayClass131_0.<AddEnvironment>g__AddEnvironmentVariable|2(String name, String value)
2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1683,3): error XAGPM7006: at Xamarin.Android.Tasks.GeneratePackageManagerJava.AddEnvironment()
2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1683,3): error XAGPM7006: at Xamarin.Android.Tasks.GeneratePackageManagerJava.RunTask()
2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1683,3): error XAGPM7006: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========
<GeneratePackageManagerJava> is not in my code. It is a section (?) in an XML (?) file that is part of Visual Studio, Xamarin.Android.Common.targets.
I'm dead in the water. I have no ideas where to start looking.