TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
211 stars 49 forks source link

Can't install the package in a NET8 MAUI project #266

Closed erossini closed 3 months ago

erossini commented 7 months ago

HI, I was traying to add this NuGet package to my .NET8 MAUI project but I get this error:

Could not find a part of the path 'C:\Users\enric.nuget\packages\xamarin.firebase.ios.installations\8.10.0.3\lib\net6.0-ios15.4\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64_x86_64-simulator\FirebaseInstallations.framework\Headers\FirebaseInstallations-umbrella.h'.

Do you know if there is a fix for it?

Thank you in advance, Enrico

twannie83 commented 7 months ago

Your NuGet package folder causes to long filepaths. Change your NuGet folder in environement variables, reboot your system after. Also a lot of other stuff to fix issues here, scroll down to Trouble Shooting image

baconsplit commented 7 months ago

The error still persists for me, even after successfully setting the NuGet path to C:\NuGet. When I go to the path described in Visual Studio, the file "client_load_reporting_filter.h" is not in the folder. Everything else of the path exists.

Any fix? Version 2.0.11 doesn't seem to work anymore in my project.

khalil2099 commented 7 months ago

The error still persists for me, even after successfully setting the NuGet path to C:\NuGet. When I go to the path described in Visual Studio, the file "client_load_reporting_filter.h" is not in the folder. Everything else of the path exists.

Any fix? Version 2.0.11 doesn't seem to work anymore in my project.

first enable long path using power shell

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Then in visual studio, Package Manager Console: dotnet build --framework net8.0-android or dotnet build --framework net8.0-ios

After that, you can build your project using visual studio (gui) without having to command line again.

erossini commented 7 months ago

After setting the registry, I continue to have the same error. I tried to download the NuGet package and unpack on the NuGet directory but the result is the same.

logikonline commented 7 months ago

The error still persists for me, even after successfully setting the NuGet path to C:\NuGet. When I go to the path described in Visual Studio, the file "client_load_reporting_filter.h" is not in the folder. Everything else of the path exists. Any fix? Version 2.0.11 doesn't seem to work anymore in my project.

first enable long path using power shell

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Then in visual studio, Package Manager Console: dotnet build --framework net8.0-android or dotnet build --framework net8.0-ios

After that, you can build your project using visual studio (gui) without having to command line again.

THis does not work - I already had that enabled and use the same folder for nugets - I wish they would shorten the path OR work with Microsoft to address this.

AdamEssenmacher commented 7 months ago

Make sure to clear your local .nuget cache before running a dotnet restore from command line.

sergiky commented 4 months ago

Hey guys, I change LongPathsEnabled to 1 then I clean the .nuget cache, rebuild the project via package command line and when I install the package the problem persist.

Some idea? imagen

elvato87 commented 4 months ago

Hello, i'm having a similar problem in Net 8 upgrading from V2.0.13 to 3.0.0, same error but with different file Could not find part of the path 'C:\Nuget\adame.firebase.ios.core\10.24.0\lib\net6.0-ios16.1\Firebase.Core.resources\FirebaseCoreInternal.xcframework\ios-arm64_x86_64-simulator\FirebaseCoreInternal.framework\Modules\FirebaseCoreInternal.swiftmodule\arm64-apple-ios-simulator.private.swiftinterface'.

I already enabled the long Path, changed the environment variables to c:\nuget, cleared nuget cache, ran dot net restore, reboot my computer but the error keeps showing up, any idea?

AdamEssenmacher commented 4 months ago

I recommend trying to isolate the problem.

If the reported file doesn't exist after running dotnet restore, then the long path issue is either at the OS level or in the dotnet tooling. If this is the case, you can try extracting the contents of the nuget to this directory manually.

If the file does exist, you can try building your iOS app from the command line. If that doesn't work, then the problem is in dotnet build.

If you can build from the command line, but not in Visual Studio, I think that would indicate that the problem is in Visual Studio itself.

Check out: https://github.com/dotnet/maui/issues/17828

elvato87 commented 4 months ago

I recommend trying to isolate the problem.

If the reported file doesn't exist after running dotnet restore, then the long path issue is either at the OS level or in the dotnet tooling. If this is the case, you can try extracting the contents of the nuget to this directory manually.

If the file does exist, you can try building your iOS app from the command line. If that doesn't work, then the problem is in dotnet build.

If you can build from the command line, but not in Visual Studio, I think that would indicate that the problem is in Visual Studio itself.

Check out: dotnet/maui#17828

So I was able to update using CLI, but now when i Try to run the project from Windows, paired to a Mac i get the following errors clang++ salió con el código 1: ld: warning: Could not find or use auto-linked library 'swiftCore' ld: warning: Could not find or use auto-linked library 'swiftCompatibility50' ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics' ld: warning: Could not find or use auto-linked library 'swiftCoreImage' ld: warning: Could not find or use auto-linked library 'swiftFileProvider' ld: warning: Could not find or use auto-linked library 'swiftOSLog' ld: warning: Could not find or use auto-linked library 'swiftObjectiveC' ld: warning: Could not find or use auto-linked library 'swiftFoundation' ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements' ld: warning: Could not find or use auto-linked library 'swiftDarwin' ld: warning: Could not find or use auto-linked library 'swiftCompatibility51' ld: warning: Could not find or use auto-linked library 'swiftQuartzCore' ld: warning: Could not find or use auto-linked library 'swiftUIKit' ld: warning: Could not find or use auto-linked library 'swif

The errors are similar in the command line 'C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : clang++ salió con el código 1: [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftCore' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftCompatibility50' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftCoreImage' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftFileProvider' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftOSLog' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftObjectiveC' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftFoundation' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftDarwin' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftCompatibility51' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftQuartzCore' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swiftUIKit' [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios] C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\targets\Xamarin.Shared.Sdk.targets(1560,3): error : ld: warning: Could not find or use auto-linked library 'swif [C:\Repos\nedchatapp2\NedChatApp\NedChatApp.csproj::TargetFramework=net8.0-ios]'

AdamEssenmacher commented 4 months ago

https://github.com/TobiasBuchholz/Plugin.Firebase/issues/303#issuecomment-2138675368