I am trying to build a new IOS release and get the following error:
"C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.After.targets(80,3): error : There was an error unzipping the file bin\iPhone\AppStore\AppBundle\MyApp.zip: Extracting Zip entry would have resulted in a file outside the specified destination directory."
The output line that generates this error is:-
"/usr/bin/zip -r /Users/fred/Library/Caches/Xamarin/mtbs/builds/MyApp/ca830d1e9af62a1e18d114cf402fd82be9cb814135209657390ffb486f0d0ee4/bin/iPhone/AppStore/AppBundle/MyApp.zip ../MyApp.app"
It appears that rather than going back to the parent directory and then zipping the "MyApp.app" directory, the process is creating a zip file with ".." as the root directory with "MyApp.app" as a sub directory, which explains the above error.
I can deploy a debug build to a device, but I cannot build an AppStore release or do an Archive process. My project previously built fine using Visual Studio 2019, but I had to upgrade to get a certificate fix that was only corrected in Visual Studio 2022.
Is there any known fixes for this issue?
I'm using:
- Visual Studio v17.3.1
- Xamarin v5.0.0.2515
- Windows 11 machine
Compiling against;
- macOS Monterey v12.5.1
- Xcode v13.4.1
bin
directory (in the project) and all the files on Mac in ~/library/caches/mtbs/builds/ and then rebuild it.