Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
k4p1cz opened this issue Jul 25, 2024 · 5 comments
Closed

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

k4p1cz opened this issue Jul 25, 2024 · 5 comments
Labels
platform/iOS 🍎 s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@k4p1cz
Copy link

k4p1cz commented Jul 25, 2024

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
@k4p1cz k4p1cz added the t/bug Something isn't working label Jul 25, 2024
Copy link
Contributor

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
Copy link
Contributor

brunck commented Jul 25, 2024

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:

  • Shorten your paths down to be VERY short, as in one or two characters. This includes your NuGet package cache folders, the folder(s) that contain your project, and the overall folder that contains all of your projects/source code. Shortening the NuGet package path is probably best done by using a nuget.config file.
  • Do NuGet restores and builds only from the command line. This is after enabling long paths in the Windows registry.
  • Only restore/build on a Mac. This is a Windows-only problem.
  • Use what used to be known as "slim bindings." Firebase is one of the examples here. The trend is to have us manage our own bindings rather than centralize it (although some bindings will be maintained such as AndroidX, etc.)

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
Copy link
Author

k4p1cz commented Jul 27, 2024

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

@brunck
Copy link
Contributor

brunck commented Jul 27, 2024

@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.

@ninachen03 ninachen03 added the s/triaged Issue has been reviewed label Sep 4, 2024
@jfversluis
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/iOS 🍎 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants