Plugin.Firebase: MAUI: Can't rebuild the app after installing Plugin.Firebase package

I can’t rebuild the app in release mode for creating APK files after the installation of Plugin.Firebase and Plugin.Firebase.Crashlytics. If I remove these packages I can rebuild and create APK file.

I follow this blog and they already suggesting to install 2 packages to prevent build errors. I did that too, still getting a lot of errors.

a

My Error screenshot:

image_2023_11_15T14_26_59_884Z

image

Severity Code Description Project File Line Suppression State Error NU1605 Warning As Error: Detected package downgrade: Xamarin.Kotlin.StdLib.Jdk8 from 1.7.20.1 to 1.7.10. Reference the package directly from the project to select a different version. MyApp -> Xamarin.AndroidX.Navigation.Runtime 2.5.2.1 -> Xamarin.AndroidX.Lifecycle.Runtime.Ktx 2.5.1.1 -> Xamarin.KotlinX.Coroutines.Android 1.6.4.1 -> Xamarin.Kotlin.StdLib.Jdk8 (>= 1.7.20.1) MyApp -> Xamarin.Kotlin.StdLib.Jdk8 (>= 1.7.10) MyApp E:\My Projects\MAUI\listpm-requester-app-maui\MyApp\MyApp.csproj 1

Severity Code Description Project File Line Suppression State Error MSB3030 Could not copy the file “C:\Users.nuget\packages\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\ext\upb-generated\envoy\api\v2\core\http_uri.upb.h” because it was not found. MyApp C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4879

Is it a known issue? Any solutions?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 42 (12 by maintainers)

Most upvoted comments

I just want to confirm I have long file paths enabled on my Win11 machine and I’m getting what I believe to be a file length error: image

I have recreated some of the problems that have already been discussed here and solved them as follows.

Installing Plugin.Firebase via nuget manager fails. image

So I installed the package via the command line, the long path (>256 characters) doesn’t seem to be a problem here. image

During the installation, the xamarin.build.download (v0.11.0) package is also installed, although a more recent version is already available. image

So I explicitly installed this more recent version for my project, which at least made this error disappear. image

Instead there was another error, which was probably due to a path that was too long (>256 characters). image

Now I have deactivated the iOS app in order to only compile the Android app. image

now another error was issued. image

I was able to eliminate this by adding the following packages.

<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" />
</ItemGroup>

Now the Android app can be compiled. image

now the question: how do you get a .net8 Maui iOS app running with firebase push messaging?

@TobiasBuchholz: Do you have the option to make the path shorter with your Plugin.Firebase?

@All: Can anyone confirm that there is no problem with the long paths in Win10, or that there is a workaround there?

ps: my system is Win11, VS 2022 17.8.3

I think the iOS problems have nothing to do with this project. This project depends on the xamarin ios firebase bindings: https://github.com/xamarin/GoogleApisForiOSComponents and other libs have the similar problems. The bindings project looks dead. MS only maintain the android firebase bindings. I contacted MS people via twitter and github and asked them to update the bindings but i get no response. To fix these issues somebody must create a new ios firebase bindings project!

@TobiasBuchholz I have updated my VS to 17.8.1, but after that also getting same list of build errors.

Do you have any idea why this is happening?

I am getting around 532 errors, I am listing a few below:

Severity Code Description Project File Line Suppression State Error MSB4064 The “AndroidFixManifests” parameter is not supported by the “XamarinDownloadArchives” task loaded from assembly: Xamarin.Build.Download, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null from the path: C:\Users\MyName.nuget\packages\xamarin.build.download\0.11.4\buildTransitive\Xamarin.Build.Download.dll. Verify that the parameter exists on the task, the <UsingTask> points to the correct assembly, and it is a settable public instance property. MyProjectName C:\Users\MyName.nuget\packages\xamarin.build.download\0.11.0\buildTransitive\Xamarin.Build.Download.targets 60

Severity Code Description Project File Line Suppression State Error MSB4063 The “XamarinDownloadArchives” task could not be initialized with its input parameters. MyProjectName C:\Users\MyName.nuget\packages\xamarin.build.download\0.11.0\buildTransitive\Xamarin.Build.Download.targets 52

Severity Code Description Project File Line Suppression State Error MSB3030 Could not copy the file “C:\Users\MyName.nuget\packages\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. MyProjectName C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4911

Severity Code Description Project File Line Suppression State Error MSB3027 Could not copy “C:\Users\MyName.nuget\packages\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\child_policy_handler.h” to “bin\Release\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpc.xcframework\ios-arm64\grpc.framework\PrivateHeaders\src\core\ext\filters\client_channel\lb_policy\child_policy_handler.h”. Exceeded retry count of 10. Failed. MyProjectName C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4911

Severity Code Description Project File Line Suppression State Error MSB3021 Unable to copy file “C:\Users\MyName.nuget\packages\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\upb-generated\src\proto\grpc\lb\v1\load_balancer.upb.h” to “bin\Release\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpc.xcframework\ios-arm64\grpc.framework\PrivateHeaders\src\core\ext\upb-generated\src\proto\grpc\lb\v1\load_balancer.upb.h”. Could not find a part of the path ‘bin\Release\net7.0-ios\iossimulator-x64\Firebase.CloudFirestore.resources\grpc.xcframework\ios-arm64\grpc.framework\PrivateHeaders\src\core\ext\upb-generated\src\proto\grpc\lb\v1\load_balancer.upb.h’. MyProjectName C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4911

Well, the sample project of the plugin is building fine, also in release mode, so I don’t know what your problem might be. If you provide a demo project I could try to look into it.

I encounter the same problem. To replicate it is easy, create a new Maui project, install Plugin.Firebase, press build in release mode OR publish, it will throw errors. I found out it is due to the MAX PATH limit around 256 character limit, targeting IOS build. Enable long path solution in Windows does not help.

Unsure is due to Maui, or Firebase plugin or Visual studio bug.