xamarin / GoogleApisForiOSComponents

MIT License
225 stars 156 forks source link

Xamarin.Firebase.iOS.Core 8.10.0.1 installation error #555

Open vivekscorp opened 2 years ago

vivekscorp commented 2 years ago

Error Could not find a part of the path 'C:\Users\vivek.nuget\packages\xamarin.firebase.ios.core\8.10.0.1\lib\xamarinios10\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_i386_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h'.

System.IO.DirectoryNotFoundException: Could not find a part of the path 'GULCCComponentContainerInternal.h'. at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) at NuGet.Packaging.PackageExtractor.<>cDisplayClass5_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Common.ConcurrencyUtilities.d51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Packaging.PackageExtractor.d5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.ProjectRestoreCommand.d16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.Commands.ProjectRestoreCommand.d15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.ProjectRestoreCommand.d9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreCommand.d62.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreCommand.d45.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreRunner.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreRunner.d10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.Commands.RestoreRunner.d3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.DependencyGraphRestoreUtility.d6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.NuGetPackageManager.d86.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.NuGetPackageManager.d73.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.VisualStudio.NuGetProjectManagerService.<>c__DisplayClass19_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.VisualStudio.NuGetProjectManagerService.d__30`1.MoveNext()

Mataboge commented 2 years ago

I can confirm the issue

sambasile commented 2 years ago

Seeing the issue on Windows 11. Path too long? Confirmed that changing my NUGET_PATH system environment variable on my computer allowed the package to install correctly. Refer to this as a temporary solution.

vivekscorp commented 2 years ago

Hi sambasile, I can't find NUGET_PATH in my system environment variables and in the link you said to refer to. Please let me know in detail if possible. Thanks

sambasile commented 2 years ago

Hi @vivekscorp. It is not there but by adding it, you can override the default value of c:\users\_currentuser_\.nuget. In my case, I set the value to c:\Nugets which reduces the file path enough for the NuGet to install properly. I also enabled long file paths in my Group Policy. (see here) and changed the manifest of devenv.com as per the same document.

NugetPath

tranb3r commented 2 years ago

@sambasile How exactly do you change the manifest of devenv.com ?

Ruvi1996 commented 2 years ago

I have the same issue

sambasile commented 2 years ago

@tranb3r my apologies, after reviewing I think I only changed the System Variable for the NuGet Packages

tranb3r commented 2 years ago

I've changed my NUGET_PACAKGES path. I'm still having this error: Could not find a part of the path 'C:\Nuget\xamarin.firebase.ios.cloudfirestore\8.10.0.1\lib\net6.0-ios15.4\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_i386_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\grpclb\client_load_reporting_filter.h' Any help ?

Mataboge commented 2 years ago

Here's what i did:

closed visual studio

  1. in the Environment Variable, added a new path "C:\Nuget" to PATH (PATH already exists, edit and add new path) added "C:\Nuget" to NUGET_PATH added "C:\Nuget" to NUGET_PACKAGES (one of these actually does the trick, dunno which one)

  2. downloaded nuget.exe and moved it to the path C:\Nuget

  3. opened command window

  4. navigated to my project solution (cd ...)

  5. ran command "nuget restore project.sln" (project.sln is the name of my solution)

NB: when ever you do a nuget clear, it will delete the nuget.exe, make sure to copy it back to the folder when you need to do a restore from the command line.

NB: if your restore does not restore and says all projects up to date, make sure to run a nuget clear all and move back the nuget.exe and do a restore again

Ruvi1996 commented 2 years ago

Increasing the path length limitation (MAX_PATH) solved the issue for me. Here’s how

tranb3r commented 2 years ago

Well, even if I increase the MAX_PATH in the registry, change the NUGET_PACKAGES path to shorten it, use the latest nuget.exe to download packages from command-line, I still end up with this exception in VS:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Nuget\xamarin.firebase.ios.cloudfirestore\8.10.0.1\lib\net6.0-ios15.4\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_i386_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\grpclb\client_load_reporting_filter.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, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at NuGet.Packaging.StreamExtensions.Testable.MmapCopy(Stream inputStream, String fileFullPath, Int64 size)
   at NuGet.Packaging.StreamExtensions.Testable.CopyToFile(Stream inputStream, String fileFullPath)
   at NuGet.Packaging.PackageFileExtractor.ExtractPackageFile(String source, String target, Stream stream)
   at NuGet.Packaging.PackageArchiveReader.CopyFiles(String destination, IEnumerable`1 packageFiles, ExtractPackageFileDelegate extractFile, ILogger logger, CancellationToken token)
   at NuGet.Packaging.PackageReaderBase.CopyFilesAsync(String destination, IEnumerable`1 packageFiles, ExtractPackageFileDelegate extractFile, ILogger logger, CancellationToken cancellationToken)
   at NuGet.Packaging.PackageExtractor.<>c__DisplayClass5_0.<<InstallFromSourceAsync>b__0>d.MoveNext()

And of course, the mentioned file DOES exist in the filesystem.

tranb3r commented 1 year ago

@SotoiGhost I would really appreciate some help from the team... Thanks.

RSaundersInfo commented 1 year ago

Getting the same error as @tranb3r. My "C:\Nugets\xamarin.firebase.ios.cloudfirestore\8.10.0.1\lib\net6.0-ios15.4\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_i386_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\grpclb" folder is empty.

Edit: no errors installing the 8.10.0 build instead of the 8.10.0.1 build.

mikequ-taggysoft commented 1 year ago

Is this going to be fixed on the source side with the next version (i.e., package maintainers shorten their strings)? Or we must manually change Nuget env variables etc to make this package work going forward? I'd hope it's the former case here.

Silv-1 commented 1 year ago

Here is what fixed the issue for me

  1. Close Visual Studio
  2. Open cmd/PowerShell
  3. Change directory to the path of the project
  4. Execute dotnet restore
  5. Open Visual Studio again
tranb3r commented 1 year ago

Here is what fixed the issue for me

  1. Close Visual Studio
  2. Open cmd/PowerShell
  3. Change directory to the path of the project
  4. Execute dotnet restore
  5. Open Visual Studio again

Ok it works for me as well.

AntHillOracle commented 1 year ago

Same issue here. Following the instructions by Mataboge solved my problem. Enabling the registry key LongPathsEnabled, or doing a dotnet restore did not work for me.

zabanet commented 1 year ago

For me, it was not enough to enble the long paths in the registry. It worked when I closed VS and then executed

dotnet add package Plugin.MauiMTAdmob --version 1.0.1

in the project directory.

robertev-alchemy commented 1 year ago

FYI - I tried all of those solutions above to no avail.

Changing nuget_packages environment variable (which broke allot of other things), restarting VS, deleting bin and obj. Nuget package path was changed successfully, did a restore, but still none of those solutions seemed to work. I got this same error when attempting nuget package install both from VS 2022 both in Nuget UX in VS, and in Package Manager Console from VS.

Then.. I closed VS and tried Developer Command prompt "dotnet add package" instead ... and what do you know?

Worked perfectly.

cwilde123 commented 1 year ago

I have this issue, Im using VS 2022 version 17.6.2 and have the latest xamarin ios firebase cloud messaging nuget installed 8.10.0.3. I get

Xamarin.Messaging.IDB.Local.DeployAppMessageHandler Error: 0 : An error occurred while trying to deploy the app 'OrionConnect.app'. Details: Could not find a part of the path 'C:\Users\xxxx\AppData\Local\Temp\Xamarin\HotRestart\Signing\OrionConnect.app\out\Payload\OrionConnect.app\OrionConnect.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FirebaseMessaging-umbrella.h'. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\xxxx\AppData\Local\Temp\Xamarin\HotRestart\Signing\OrionConnect.app\out\Payload\OrionConnect.app\OrionConnect.content\Firebase.CloudMessaging.resources\FirebaseMessaging.xcframework\ios-arm64\FirebaseMessaging.framework\Headers\FirebaseMessaging-umbrella.h'

I have tried all solutions on here like enabling long file paths, setting enviromental variables, editing nuget.config paths, runnig dotnet restore and dotnet add package and it still gives me this. It seems vs 2022 uses a hotreload directory to copy over these files and i dont know if its still to long path. I tried disabling hot reload but that doesnt work. Im not sure what to do. I tried running this on remote device and that also fails. I tried runnig it on vs 2022 on mac and it does compile successfully so something is not working right on VS 2022. The nuget or VS needs to get a fix to resolve this

EmilAlipiev commented 1 year ago

this is definitely related to Xamarin.Firebase.iOS.Core 8.10.0.1 version, at least directly on Mac. When I downgrade to the v6.x , everything works as before.

Meekohi commented 1 year ago

Issue for me as well. I can't decide whether it's crazier that Windows 11 still has these filepath limitations, or that Xamarin Firebase felt the need to create a path this absurdly long as part of their build process. 🤷🏼

JohanvanderMerwe commented 1 year ago

Hi, the issue also persists for me. Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.2. The sample works well with Maui .net6. However, when you use .net7, the Xamarin.Firebase.Ios.Core errors start popping up.

I have tried the following: 1) Changed my Nuget packages folder, NUGET_PACKAGES as suggested above. Didnt help. 2) Set my Windows to use Long file names as suggested above in the registry (LongPathsEnabled). Didnt help. 3) I have tried the dotnet add package suggestion to add the nuget package via the Developer Cmd prompt. Didnt help. 4) I have then tried using older versions of the nuget packages. This worked up to a point. But then the plugin.mtmob package required later Xamarin.Firebase packages, so no, it didnt work.

Unfortunately I have written my whole project using the Communitytoolkit.maui toolkit package, and it has a minimum requirement of .net7 to work. So now I am running out of fresh ideas.

Perhaps if soemone out there could post a sample solution of mtadmob using .net7 it would be great. I will also give it a go myself, but I dont think my skills are at a level where I will be able to get that working.

Any help will be much appreciated.

SeriousM commented 1 year ago

Hi, the issue also persists for me. Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.2. The sample works well with Maui .net6. However, when you use .net7, the Xamarin.Firebase.Ios.Core errors start popping up.

For me it's Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.6.4 on Windows 10 Pro 22H2 19045.3086 with the nuget package xamarin.firebase.ios.cloudfirestore version 8.10.0.3 and my maui project using .net7 because of the dependencies.

I don't know why but last week everything was fine and this week it broke.

I tried all solutions above:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(4862,5): error MSB3021: Unable to copy file "C:\n\xamarin.firebase.ios.cloudfirestore\8.10.0.3\lib\net6.0-ios15.4\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\tsi\alts\zero_copy_frame_protector\alts_zero_copy_grpc_protector.h" to "bin\Debug\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\tsi\alts\zero_copy_frame_protector\alts_zero_copy_grpc_protector.h". Could not find a part of the path 'bin\Debug\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\tsi\alts\zero_copy_frame_protector\alts_zero_copy_grpc_protector.h'.

Its about 134 files that can't be copied because of the "can't find file" issue.

For us the nuget package https://www.nuget.org/packages/Plugin.Firebase.Core/ with direct dependency to [Xamarin.Firebase.iOS.Core](https://www.nuget.org/packages/Xamarin.Firebase.iOS.Core/) (>= 8.10.0.3) for net6-ios16.0 is the issue, yet it worked a week before.

Ah yes, we also played around with the dotnet workload restore and dotnet workload repair as well as reairing (actually reset and reinstalling) visual studio just to make the day interesting.

Is there anything we can do?! We ran several times into such issues over the last year yet it was always fixable somehow.

leowagnersouza commented 11 months ago

Same problem here, none of the above solutions worked. Or better they did worked and fixed all the packages, except xamarin.firebase.ios.core, that have a extreme long path name. Any ideas?

itoledo commented 10 months ago

Problem occurs because on Windows it'll try to copy Firebase framework files to your bin path on your project's folder, appending paths that will go over the max path length.

Workaround is to put this somewhere on a PropertyGroup:

<BaseOutputPath>c:\temp\build\bin</BaseOutputPath>

It's an ugly hack and won't work with CI builds but makes building/debugging possible on Windows. This will put your bin folder on a shorter path (it can be anything you like!) and builds will complete succesfully.

play4uman commented 9 months ago

Hi, the issue also persists for me. Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.2. The sample works well with Maui .net6. However, when you use .net7, the Xamarin.Firebase.Ios.Core errors start popping up.

For me it's Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.6.4 on Windows 10 Pro 22H2 19045.3086 with the nuget package xamarin.firebase.ios.cloudfirestore version 8.10.0.3 and my maui project using .net7 because of the dependencies.

I don't know why but last week everything was fine and this week it broke.

I tried all solutions above:

  • my user nuget.config is modified to set the nuget folder by using nuget.exe config -set repositoryPath=C:\n and nuget.exe config -set globalPackagesFolder=C:\n
  • my nuget folder is at C:\n and is used during restores
  • my project is at C:\dev\XXXXXXXXXX\XXXXX\XXXXXXXXX\XXXXXXXXX\XXXXXXXXXXXXXXXXXXX.csproj (the count of X is related to the path)
  • I have long-paths enabled
  • I have the env-vars NUGET_PACKAGES and NUGET_PATH set just in case...
  • a fresh nuget.exe resides in C:\n\nuget.exe
  • Visual Studio Package restore fails with the error System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
  • a dotnet restore worked flawless
  • a dotnet build worked flawless
  • Visual Studio Build fails with the problem that iOS package can't be copied even the file exists:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(4862,5): error MSB3021: Unable to copy file "C:\n\xamarin.firebase.ios.cloudfirestore\8.10.0.3\lib\net6.0-ios15.4\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\tsi\alts\zero_copy_frame_protector\alts_zero_copy_grpc_protector.h" to "bin\Debug\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\tsi\alts\zero_copy_frame_protector\alts_zero_copy_grpc_protector.h". Could not find a part of the path 'bin\Debug\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\tsi\alts\zero_copy_frame_protector\alts_zero_copy_grpc_protector.h'.

Its about 134 files that can't be copied because of the "can't find file" issue.

For us the nuget package https://www.nuget.org/packages/Plugin.Firebase.Core/ with direct dependency to [Xamarin.Firebase.iOS.Core](https://www.nuget.org/packages/Xamarin.Firebase.iOS.Core/) (>= 8.10.0.3) for net6-ios16.0 is the issue, yet it worked a week before.

Ah yes, we also played around with the dotnet workload restore and dotnet workload repair as well as reairing (actually reset and reinstalling) visual studio just to make the day interesting.

Is there anything we can do?! We ran several times into such issues over the last year yet it was always fixable somehow.

I'm facing in the exact same situation and none of the solutions mentioned in this issue helped. This is extremely disappointing since it makes development practically impossible. Why is there no fix yet (as of September 2023) for this critical issue?

alzubitariq commented 9 months ago

1- Close all visual studio instances. 2- Run PowerShell as Administrator and exeute this command.

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

3- Create a new folder and name it "nuget" in C drive. 4- Again run PowerShell as Administrator and exeute this command

that's it ....:)

SeriousM commented 9 months ago

1- Close all visual studio instances. 2- Run PowerShell as Administrator and exeute this command.

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

3- Create a new folder and name it "nuget" in C drive. 4- Again run PowerShell as Administrator and exeute this command

that's it ....:)

That's it for you. My setup had already all these steps, including an "n" folder on C: just to make the paths as short as possible.

ciara-kyles-williams commented 9 months ago

1- Close all visual studio instances. 2- Run PowerShell as Administrator and exeute this command.

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

3- Create a new folder and name it "nuget" in C drive. 4- Again run PowerShell as Administrator and exeute this command

that's it ....:)

Thank you, this was very helpful and solved the issue for me.

hharvey84 commented 9 months ago

1- Close all visual studio instances. 2- Run PowerShell as Administrator and exeute this command. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabl ed" -Value 1 -PropertyType DWORD -Force 3- Create a new folder and name it "nuget" in C drive. 4- Again run PowerShell as Administrator and exeute this command

that's it ....:)

Thank you, this was very helpful and solved the issue for me.

Seconded. I was successfully able to proceed after following these steps, thank you.

danielheddelin commented 8 months ago

I have tried everything suggested but still get install-package : Could not find a part of the path 'C:\N\xamarin.firebase.ios.cloudfirestore\8.10.0.3\lib\xamarinios10\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\grpclb\client_load_reporting_filter.h'.

Any news? This is a subdependency of Plugin.Firebase that I need to install.

danielheddelin commented 8 months ago

I have tried everything suggested but still get install-package : Could not find a part of the path 'C:\N\xamarin.firebase.ios.cloudfirestore\8.10.0.3\lib\xamarinios10\Firebase.CloudFirestore.resources\grpcpp.xcframework\ios-arm64_x86_64-simulator\grpcpp.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\grpclb\client_load_reporting_filter.h'.

Any news? This is a subdependency of Plugin.Firebase that I need to install. Solved it. Installing the package via package manager console in visual studio does NOT work. Running "dotnet add package plugin.firebase" in powershell - in the project root, works.

harima34 commented 7 months ago

Any workaround ? i got the same issue and previous workaround didn't work

marcelbeeker commented 7 months ago

I'm still having these issues concerning long file paths too. I did all of the suggestions as mentioned above. Still without succes. Are there any updates because I think there is a bug in this NuGet packages. The file paths are extremely long here.

The workaround for me was disable targeting ios in the project file :-(

KarsaOrlong1981 commented 7 months ago

When you want to install Plugin.Firebase for me it works when I add following pakages, you can add it directly into csproj:

<PackageReference Include="Plugin.Firebase" Version="2.0.9" />
<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" />

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
    <PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.2" />
    <PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.1" />
    <PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
    <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />
    <PackageReference Include="Xamarin.AndroidX.Browser" Version="1.6.0.2" />
       <PackageReference Include="Xamarin.AndroidX.Browser" Version="1.6.0.2" />
</ItemGroup>

And when you have Xamarin.GooglePlayServices.Basement installed you have to set the Version to 118.2.0.4

dustinrbb commented 7 months ago

For anyone like me who has been banging their head trying to solve this problem and have tried all steps above to no avail, I did find that the main culprit of this issue (at least for me) was associated with the long file name path, as others above have pointed out.

All the steps above still seemed to fail for me though until I found that this was actually due to me attempting to Rebuild the solution from Visual Studio after running the nuget restore command in powershell for the project. From what I could find, this is due to VS not utilizing the long file name registry for some reason. I found that I could still build the solution without issue and run the application, but restore needed to be run manually through the terminal. Thanks everyone above for finding the actual solution, I just wanted to point this out for anyone who is running into this road block.

TL;DR - Don't fully rebuild after running nuget restore or dotnet restore in the terminal. Just build the application. This is what works for me at least.

IeuanWalker commented 6 months ago

639

GiuseppeGiacalone commented 6 months ago

I was able to install the packet in my project and it works for Android. But when I try on iOS I get theese errors:

Error MSB3027 Could not copy "C:\Users\g\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\lib\net6.0-ios15.4\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h" to "C:\Users\g\AppData\Local\Temp\Xamarin\HotRestart\Signing\AppName.app\out\AppName.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h". Exceeded retry count of 10. Failed. AppName C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\16.4.7125\tools\msbuild\iOS\Xamarin.iOS.HotRestart.targets 264

Error MSB3021 Unable to copy file "C:\Users\g\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\lib\net6.0-ios15.4\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h" to "C:\Users\g\AppData\Local\Temp\Xamarin\HotRestart\Signing\AppName.app\out\AppName.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h". Could not find a part of the path 'C:\Users\g\AppData\Local\Temp\Xamarin\HotRestart\Signing\AppName.app\out\AppName.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h'. AppName C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\16.4.7125\tools\msbuild\iOS\Xamarin.iOS.HotRestart.targets 264

and

Error MSB3021 Unable to copy file "C:\Users\g\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\lib\net6.0-ios15.4\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\Headers\GoogleUtilitiesComponents-umbrella.h" to "C:\Users\g\AppData\Local\Temp\Xamarin\HotRestart\Signing\AppName.app\out\AppName.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\Headers\GoogleUtilitiesComponents-umbrella.h". Could not find a part of the path 'C:\Users\g\AppData\Local\Temp\Xamarin\HotRestart\Signing\AppName.app\out\AppName.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\Headers\GoogleUtilitiesComponents-umbrella.h'. AppName C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\16.4.7125\tools\msbuild\iOS\Xamarin.iOS.HotRestart.targets 264

Error MSB3027 Could not copy "C:\Users\g\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\lib\net6.0-ios15.4\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h" to "C:\Users\g\AppData\Local\Temp\Xamarin\HotRestart\Signing\AppName.app\out\AppName.content\Firebase.Core.resources\GoogleUtilitiesComponents.xcframework\ios-arm64_x86_64-simulator\GoogleUtilitiesComponents.framework\PrivateHeaders\GULCCComponentContainerInternal.h". Exceeded retry count of 10. Failed. AppName C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\16.4.7125\tools\msbuild\iOS\Xamarin.iOS.HotRestart.targets 264

any solution?

XhaiiCo commented 5 months ago

I solved this problem by upgrading my project to .NET 8, I don't know if that's what really solved the problem or if it's just a coincidence, but it's worth a try.

mahebisht commented 5 months ago

I have .Net 8. I believe there is workaround for this issue in Windows10. But this workaround is not working on Windows11. I think there is an issue with long filename on windows 11

mahebisht commented 5 months ago

1- Close all visual studio instances. 2- Run PowerShell as Administrator and exeute this command. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabl ed" -Value 1 -PropertyType DWORD -Force 3- Create a new folder and name it "nuget" in C drive. 4- Again run PowerShell as Administrator and exeute this command

that's it ....:)

Thank you, this was very helpful and solved the issue for me.

Seconded. I was successfully able to proceed after following these steps, thank you.

Are you using Windows 10 ?

JamesHalldorsson commented 5 months ago

Here is how I fixed the problem, it's a combination of some of the aforementioned methods.

1) firstly go into your registry editor, run as an administrator navigate to this path Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

2) change the LONGPATHSENABLED to 1 (true) and save changes.

3) Reset your computer

4) once you have reset, go to the Developer Command Prompt for visual studio.

5) Change directory to the directory containing your .csproj file with the command cd /d and then followed by the path

6) once you are in this directory, execute the command: dotnet add package Plugin.MauiMTAdmob --version 1.0.4

If you follow these steps in sequence, this should install the package.

BTSoft308 commented 5 months ago

Is there any chance for those who (like me) have tried all of the above and still can't build because of this package dependency? Created the nuget_packages variable as "c:\N" , chose "c:\b" as output build folder, did a dotnet restore, installed the package (Plugin.Firebase) through command line, enabled long paths (which VS seems to ignore at least on Win11)... is it ever possible in 2024 windows still deals with the path length limitation? Out of curiosity I've tried a "dotnet build MyApp" from shell and it correctly builds both android and ios... I'm quite lost here

khalil2099 commented 5 months ago

Is there any chance for those who (like me) have tried all of the above and still can't build because of this package dependency? Created the nuget_packages variable as "c:\N" , chose "c:\b" as output build folder, did a dotnet restore, installed the package (Plugin.Firebase) through command line, enabled long paths (which VS seems to ignore at least on Win11)... is it ever possible in 2024 windows still deals with the path length limitation? Out of curiosity I've tried a "dotnet build MyApp" from shell and it correctly builds both android and ios... I'm quite lost here

i dont know why, but after doing 'dotnet add package Plugin.MauiMTAdmob --version 1.0.4', i could compile my project.

BTSoft308 commented 5 months ago

Is there any chance for those who (like me) have tried all of the above and still can't build because of this package dependency? Created the nuget_packages variable as "c:\N" , chose "c:\b" as output build folder, did a dotnet restore, installed the package (Plugin.Firebase) through command line, enabled long paths (which VS seems to ignore at least on Win11)... is it ever possible in 2024 windows still deals with the path length limitation? Out of curiosity I've tried a "dotnet build MyApp" from shell and it correctly builds both android and ios... I'm quite lost here

i dont know why, but after doing 'dotnet add package Plugin.MauiMTAdmob --version 1.0.4', i could compile my project.

Unfortunately that also did not work for me

khalil2099 commented 5 months ago

Is there any chance for those who (like me) have tried all of the above and still can't build because of this package dependency? Created the nuget_packages variable as "c:\N" , chose "c:\b" as output build folder, did a dotnet restore, installed the package (Plugin.Firebase) through command line, enabled long paths (which VS seems to ignore at least on Win11)... is it ever possible in 2024 windows still deals with the path length limitation? Out of curiosity I've tried a "dotnet build MyApp" from shell and it correctly builds both android and ios... I'm quite lost here

i dont know why, but after doing 'dotnet add package Plugin.MauiMTAdmob --version 1.0.4', i could compile my project.

Unfortunately that also did not work for me

Are you doing for Android or iOS ?

BTSoft308 commented 5 months ago

Is there any chance for those who (like me) have tried all of the above and still can't build because of this package dependency? Created the nuget_packages variable as "c:\N" , chose "c:\b" as output build folder, did a dotnet restore, installed the package (Plugin.Firebase) through command line, enabled long paths (which VS seems to ignore at least on Win11)... is it ever possible in 2024 windows still deals with the path length limitation? Out of curiosity I've tried a "dotnet build MyApp" from shell and it correctly builds both android and ios... I'm quite lost here

i dont know why, but after doing 'dotnet add package Plugin.MauiMTAdmob --version 1.0.4', i could compile my project.

Unfortunately that also did not work for me

Are you doing for Android or iOS ?

For both platforms

khalil2099 commented 5 months ago

Is there any chance for those who (like me) have tried all of the above and still can't build because of this package dependency? Created the nuget_packages variable as "c:\N" , chose "c:\b" as output build folder, did a dotnet restore, installed the package (Plugin.Firebase) through command line, enabled long paths (which VS seems to ignore at least on Win11)... is it ever possible in 2024 windows still deals with the path length limitation? Out of curiosity I've tried a "dotnet build MyApp" from shell and it correctly builds both android and ios... I'm quite lost here

i dont know why, but after doing 'dotnet add package Plugin.MauiMTAdmob --version 1.0.4', i could compile my project.

Unfortunately that also did not work for me

Are you doing for Android or iOS ?

For both platforms

i finally got it working for both iOS and Android. what error did you get ? maybe i can help you.

BTSoft308 commented 5 months ago

The same error caused by the too long path: "Could not copy the file 'C:\N\xamarin.firebase.ios.cloudfirestore\8.10.0.3\lib\net6.0-ios15.4\Firebase.CloudFirestore.resources\grpc.xcframework\ios-arm64\grpc.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\grpclb\client_load_reporting_filter.h' because it was not found.". Not only for this particular file but along with another 260 files for the same plugin.