FirebasePushNotificationPlugin icon indicating copy to clipboard operation
FirebasePushNotificationPlugin copied to clipboard

Using VS22 Xamarin

Open wickshot opened this issue 3 years ago • 12 comments

🐛 Bug Report

When I add the NuGet package and the try to run on the iPhone I get the error below.

The "UnpackFrameworks" task failed unexpectedly. System.IO.IOException: The file 'obj\iPhone\Debug\device-builds\iphone7.2-12.5.5/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() AppTest.iOS

NuGet V3.4.25, I have tried previous version same result.

The Android compiles and deploys without issues

Platform:

  • [ ] :iphone: iOS

wickshot avatar Aug 02 '22 12:08 wickshot

Same here... Do you found a workaround?

Found a discussion about it:

https://github.com/CrossGeeks/FirebasePushNotificationPlugin/issues/428

ErickVal avatar Aug 03 '22 16:08 ErickVal

Do you try to delete obj and bin folders via file manager?

AlleSchonWeg avatar Aug 04 '22 07:08 AlleSchonWeg

Same here... Do you found a workaround?

Found a discussion about it:

#428

No, not yet, started coding in swift!

wickshot avatar Aug 04 '22 12:08 wickshot

Do you try to delete obj and bin folders via file manager?

Yes, tried this, same result

wickshot avatar Aug 04 '22 12:08 wickshot

Do you try to delete obj and bin folders via file manager?

Yes, tried this, same result

Try disable hot restart and/or hot reload. Do you have manually installed some Xamarin.Firebase.* nugets?

The path in your error message looks crazy. Mixed with slashe and backslashes.

AlleSchonWeg avatar Aug 04 '22 12:08 AlleSchonWeg

No, no other firebase nuggets installed. I've even tried installing on a new clean project, same result when I try to run on iOS

wickshot avatar Aug 04 '22 18:08 wickshot

I guess its a dependency problem by https://github.com/xamarin/GoogleApisForiOSComponents/issues/564 in which this package needs to be updated asap.

Luisalvarenga avatar Aug 05 '22 02:08 Luisalvarenga

I updated the following nugets (ios Project) via Transitive packages to version 8.10:

<PackageReference Include="Xamarin.Firebase.iOS.CloudMessaging">
  <Version>8.10.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.iOS.Installations">
  <Version>8.10.0</Version>
</PackageReference>

Every time i need to delete obj folder via explorer to compile successfully.

AlleSchonWeg avatar Sep 20 '22 15:09 AlleSchonWeg

Another workaround is to edit Xamarin.iOS.HotRestart.targets file:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.HotRestart.targets Path depends on your VS version.

Search UnpackFrameworks node and add ContinueOnError="true". Like this:

		<UnpackFrameworks ContinueOnError="true"
			ReferencedAssemblies="@(AssembliesWithFrameworks)"
			IntermediateOutputPath="$(DeviceSpecificIntermediateOutputPath)">

			<Output TaskParameter="Frameworks" ItemName="_UnpackedFramework" />
		</UnpackFrameworks>

AlleSchonWeg avatar Sep 21 '22 13:09 AlleSchonWeg

I don't have an UnpackFrameworks node in my Xamarin.iOS.HotRestart.targets. Where in the file should this setting live?

JayWilk avatar Feb 27 '23 21:02 JayWilk

ffs, i have nothing but problems trying to develop a very simple app using Xamarin / MAUI, think I'll switch to react native this has been the last straw tbh

JayWilk avatar Feb 27 '23 21:02 JayWilk

WebcomCompany

Use Other Platforms Look like 'onesignal' I have Same problem and I became the axis of change

WebcomCompany avatar Apr 20 '23 05:04 WebcomCompany