dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

[iOS] "Could not find a part of the path" Firebase CloudMessaging #23829

Closed k4p1cz closed 4 days ago

k4p1cz commented 1 month ago

Description

Hello.

I have a problem that I've been strugling with. I want to test Firebase notifications for my iOS project so I've created a new one to test it on. I've added Xamarin.Firebase.iOS.Core and Xamarin.Firebase.iOS.CloudMessaging as well as GoogleService-Info.plist and Entitlements.plist. I've edited the AppDelegate.cs accordingly. When I try to build it, it builds with no issues but when I try to deploy the app to my local device I get a deploy error.

The log from Xamarin\Logs\17.0 is listed in "Relevant log output" but the error is: "An error occurred while trying to create the .ipa file for TestIOS2. Details: Could not find a part of the path 'C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\Payload\TestIOS2.app\TestIOS2.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FIRMessagingExtensionHelper.h'."

If you need anything that will help you, let me know. I'm new in .NET MAUI.

Thank you!

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.61 SR6.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

, _iOSRuntimeIdentifier: ios-arm64, IsHotRestartBuild: True, IsHotRestartEnvironmentReady: True: 07/25/2024 11:58:03Z
    DateTime=2024-07-25T11:58:03.0845400Z: 07/25/2024 11:58:03Z
Xamarin.Messaging.IDB.Local.GetMobileDeviceConfigurationMessageHandler Information: 0 : Apple Support - iTunes installed: 'True', Installation type: 'Store': 07/25/2024 11:58:03Z
    DateTime=2024-07-25T11:58:03.3789356Z: 07/25/2024 11:58:03Z
Xamarin.iOS.Windows.Installer.ApplicationSession Information: 0 : Creating application ipa file: C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\TestIOS2.ipa: 07/25/2024 11:58:03Z
    DateTime=2024-07-25T11:58:03.5502453Z: 07/25/2024 11:58:03Z
Xamarin.iOS.Windows.Installer.ApplicationSession Error: 0 : An error occurred while trying to create the .ipa file for TestIOS2. Details: Could not find a part of the path 'C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\Payload\TestIOS2.app\TestIOS2.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FIRMessagingExtensionHelper.h'.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\Payload\TestIOS2.app\TestIOS2.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FIRMessagingExtensionHelper.h'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.Compression.ZipFileExtensions.DoCreateEntryFromFile(ZipArchive destination, String sourceFileName, String entryName, Nullable`1 compressionLevel)
   at System.IO.Compression.ZipFile.DoCreateFromDirectory(String sourceDirectoryName, String destinationArchiveFileName, Nullable`1 compressionLevel, Boolean includeBaseDirectory, Encoding entryNameEncoding)
   at Xamarin.iOS.Windows.Installer.ApplicationSession.CreateIpa(String appName, String appPath, String targetPath) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\Installer\ApplicationSession.cs:line 230: 07/25/2024 11:58:04Z
    DateTime=2024-07-25T11:58:04.7355831Z: 07/25/2024 11:58:04Z
Xamarin.iOS.Windows.HotRestartClient Error: 0 : Deploy Error: Could not find a part of the path 'C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\Payload\TestIOS2.app\TestIOS2.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FIRMessagingExtensionHelper.h'.: 07/25/2024 11:58:04Z
    DateTime=2024-07-25T11:58:04.7362190Z: 07/25/2024 11:58:04Z
Xamarin.Messaging.IDB.Local.DeployAppMessageHandler Error: 0 : An error occurred while trying to deploy the app 'TestIOS2.app'. Details: Could not find a part of the path 'C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\Payload\TestIOS2.app\TestIOS2.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FIRMessagingExtensionHelper.h'.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\FantasyCZE\AppData\Local\Temp\Xamarin\HotRestart\Signing\TestIOS2.app\out\Payload\TestIOS2.app\TestIOS2.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FIRMessagingExtensionHelper.h'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.Compression.ZipFileExtensions.DoCreateEntryFromFile(ZipArchive destination, String sourceFileName, String entryName, Nullable`1 compressionLevel)
   at System.IO.Compression.ZipFile.DoCreateFromDirectory(String sourceDirectoryName, String destinationArchiveFileName, Nullable`1 compressionLevel, Boolean includeBaseDirectory, Encoding entryNameEncoding)
   at Xamarin.iOS.Windows.Installer.ApplicationSession.CreateIpa(String appName, String appPath, String targetPath) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\Installer\ApplicationSession.cs:line 238
   at Xamarin.iOS.Windows.Installer.ApplicationSession.Deploy(String appRootFolder, String appBundleId, String appName) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\Installer\ApplicationSession.cs:line 91
   at Xamarin.iOS.Windows.HotRestartClient.Deploy(AppleDevice nativeDevice, String appBundleId, String appBundleName, Boolean& incremental) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\HotRestartClient.cs:line 250
   at Xamarin.Messaging.IDB.Local.DeployAppMessageHandler.<ExecuteAsync>d__5.MoveNext() in D:\a\_work\1\s\src\Messaging\Xamarin.Messaging.IDB.Local\Handlers\DeployAppMessageHandler.cs:line 43: 07/25/2024 11:58:04Z
    DateTime=2024-07-25T11:58:04.7362190Z: 07/25/2024 11:58:04Z
github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

brunck commented 1 month ago

Assuming you're using VS for Windows, this is the "max path" error. Enabling long paths in Windows won't help; VS ignores that setting. This problem has been known for years and may never be fixed. Your options are to:

In short, this is not a MAUI problem, and not even a .NET for iOS problem (specifically). It's a Visual Studio on Windows problem.

k4p1cz commented 1 month ago

@brunck Thank you. I'll try that. But where can I find nuget.config file?

brunck commented 1 month ago

@brunck Thank you. I'll try that. But where can I find nuget.config file?

You create it yourself. Search the documentation; it’ll have more information.

jfversluis commented 4 days ago

I don't think this is the MaxPath issue. From the logs I can tell you are using Hot Restart and as part of the limitations you cannot use xcframework resources.

If you want to use this, you will have to deploy through Mac hardware.

Closing this here as there is nothing we can do about this currently.