CrossGeeks/FirebasePushNotificationPlugin

"UnpackFrameworks" task failed unexpectedly - FirebaseMessaging already exists

nemekzg opened this issue · 5 comments

Since about mid-April, we're struggling with building iOS Xamarin Forms multi-os App on a Windows machine (Visual Studio 17.1.x and 17.2.0, FirebasePushNotifications 3.4.1+) due to:

Error The "UnpackFrameworks" task failed unexpectedly. System.IO.IOException: The file 'obj\iPhone\Debug\device-builds\iphone9.3-15.4/Frameworks\FirebaseMessaging.framework\FirebaseMessaging' already exists. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost) at System.IO.FileInfo.CopyTo(String destFileName) at Xamarin.iOS.Tasks.Windows.Zip.CopyDirectory(String source, String destination) in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.iOS.Tasks.Windows/Zip.cs:line 32 at Xamarin.iOS.Tasks.Windows.Zip.Extract(String sourceFileName, String destinationPath) in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.iOS.Tasks.Windows/Zip.cs:line 18 at Xamarin.iOS.HotRestart.Tasks.UnpackFrameworks.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.iOS.Tasks.Windows/Tasks/UnpackHotRestartFrameworks.cs:line 55 at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

This stopped working at some point with no package upgrade on our side. The problem is gone if we remove FirebasePushNotificationPlugin from the project entirely. Removing it from iOS only does not help. Neither does clearing the obj directories.

I see that u are using HotRestart. 99% sure the problem is with it. Try on a mac

I'd love to, but we've got none. As a workaround: I've discovered that VS 2019 16.11.13 works.

ktkk commented

Hi, I am having the same issue.
I have set up a simple macOS VM to verify that it does indeed work over there on the iOS simulator, but for several reasons it is not possible to continue developing the app on macOS.

What I've tried in Visual Studio on Windows:

  • Downgrade the plugin.
  • Use the preview version of VS (17.3.0 preview 2.0).
  • Use VS 2019 (16.11.16, as I have no idea how to downgrade VS versions).
  • Manually delete the files it complains about already existing.
  • Edit the targets file according to the comment above.
  • Get a spare PC from the office and did a complete fresh install of VS & Xamarin and create a new Xamarin project with the plugin.
    None of these resulted in a different outcome.

Any ideas what else I can do to fix this issue?