-
Notifications
You must be signed in to change notification settings - Fork 161
Maui - iOS push notification cannot be set up - Could not find a part of the path (Path too long) #630
Comments
Yeah , i found this problem too T^T |
Try clearing your local nuget cache and run a |
Hi, I could manage the problem and now I can compile the iOS .Net 8 Maui App with Pulgin.Firtebase. I used "dotnet restore" to get the nuget package. But now I'd like to publish the app and I can't create an archive with the Archive Manager from Visual Studio 2022, because the path is too long! The zip file can be craeted, but the Unzip task crashes. The path, where the zip file is created is: |
In the past, .NET iOS binding libraries were packed into .dll files. This led to naturally shorter file paths (e.g. Apple has shifted to using XCFrameworks as the standard binary packaging format. This leads to naturally longer file paths (e.g Visual Studio (Windows) is fundamentally incapable of dealing with longer file paths like this. See: The punchline is that Visual Studio (Windows) is simply no longer a reliably viable tool for building or archiving iOS apps (MAUI or otherwise). |
I fixed this by changing the nuget package location to a path that’s shorter than the default path. I did this by adding the following configuration to my NuGet.Config.
|
I think the really well solution were the support of long path in Visual Studio 2022. It's awkward, that it can cope with long path till today. PS. I had the same problem with an another Nuget Package -> Scandit for .Net Maui. The developer changed the names to much shorten ones, and now it works without any problem. |
You cannot simply change names in an XCFramework. They need to match the module names. |
That's a workaround - not a fix ;) . A fix would prevent the problem from happening in the first place! |
i try this but C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(4911,5) : warning MSB3026: Could not copy to Beginning retry 2 in 1000ms. Could not find a part of the path |
For anyone who have still problem with long paths (size bigger than 260 characters).
Combination of following might help you. |
Using the Xamarin.Firebase.iOS.CloudMessaging nuget in .NET Maui.
Android works fine, but in iOS we get this error. I believe it is because the file path is too long - however I have set the system settings to enable long paths and still get this exception.
**An error occurred while trying to deploy the app 'SamplePush.app'. Details: Could not find a part of the path
'C:\Users\username\AppData\Local\MyTempFiles\Xamarin\HotRestart\Signing\SamplePush.app\out\Payload\SamplePush.app\SamplePush.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FirebaseMessaging-umbrella.h'.**
I changed my temp file location to be shorter C:\tmp but still get the following:
**An error occurred while trying to deploy the app 'SamplePush.app'. Details: Could not find a part of the path
'C:\Tmp\Xamarin\HotRestart\Signing\SamplePush.app\out\Payload\SamplePush.app\SamplePush.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\Headers\GoogleUtilitiesComponents-umbrella.h'**
The text was updated successfully, but these errors were encountered: