OneSignal/OneSignal-DotNet-SDK

[question]: MAUI - Error updating nuget from 4.3.3 to 5.0.2

Opened this issue · 4 comments

How can we help?

When trying to update the nuget package in our MAUI app from 4.3.3 to 5.0.2 or any 5.X.X i get the following error:

Path not found:
C:\Users\DaveXXXXX.nuget\packages\onesignalsdk.dotnet\5.0.2\res\ios\OneSignalFramework.xcframework\ios-arm64_x86_64-maccatalyst\OneSignalFramework.framework\Versions\Current\Modules\OneSignalFramework.swiftmodule\x86_64-apple-ios-macabi.private.swiftinterface

The path is 260 characters long but i already enabled "LongPaths" in windows registry.

Is this really a path problem or did anyone have this problem?

Code of Conduct

  • I agree to follow this project's Code of Conduct

What version of Xcode and .Net are you using?

Same problem with XCode 15.0.1 in distant Mac and .net Maui 8 with Visual Studio 2022 v 17.8.1 windows 11

Same problem.

Same problem here.

This is how i fixed it:

  1. Run this powershell to support "Long Path" in Windows 10/11
New-ItemProperty `
    -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
    -Name "LongPathsEnabled" `
    -Value 1 `
    -PropertyType DWORD `
    -Force
  1. Create a new directory for NuGet packages => C:\n
  2. Add the new directory to a environment variable: NUGET_PACKAGES = C:\n
  3. Go to your project directory and run dotnet add package OneSignalSDK.DotNet from Console using .NET CLI.
    Do not add the package from within VS

(Credits: @TobiasBuchholz)