xamarin / GoogleApisForiOSComponents

MIT License
225 stars 156 forks source link

Crashlytics symbols upload expects GoogleServices-Info.plist to be in the root of the project #598

Open svaldetero opened 1 year ago

svaldetero commented 1 year ago

I have a net6.0-ios MAUI application. I have added Crashlytics like this at the bottom of my csproj:

<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
    <BundleResource Include="Platforms\iOS\GoogleService-Info.plist" Link="GoogleService-Info.plist" />
    <PackageReference Include="Xamarin.Firebase.iOS.Crashlytics" Version="8.10.0.3" />
</ItemGroup>

However when I do my build in Azure Devops, I get this issue:

  error: Unable to read Google Service plist at path /Users/runner/work/1/s/Mobile/src/Maui/GoogleService-Info.plist
/Users/runner/.nuget/packages/xamarin.firebase.ios.crashlytics/8.10.0.3/buildTransitive/Xamarin.Firebase.iOS.Crashlytics.targets(41,5): warning MSB3073: The command "'/Users/runner/Library/Caches/XamarinBuildDownload/FCrshlytcs-8.9.1/upload-symbols.sh' -gsp '/Users/runner/work/1/s/Mobile/src/Maui/GoogleService-Info.plist' -p ios '/Users/runner/work/1/s/Mobile/src/Maui/bin/Release/net6.0-ios/ios-arm64/MyApp.app.dSYM'" exited with code 13. [/Users/runner/work/1/s/Mobile/src/Maui/MyApp.csproj]

That seems to be because of this line: https://github.com/xamarin/GoogleApisForiOSComponents/blob/241842edea9142a5fe86a20f81caedda05dde2e6/source/Firebase/Crashlytics/Crashlytics.targets#L41

How can I specify where the plist is to MSBuild or does it have to be at the root of the MAUI project?

mdima commented 1 year ago

Hello, same issue here, 100% the same. Hope to get an idea how to fix it.

MarkMcCormackSF commented 11 months ago

Same or similar issue here, I'm building a MAUI for iOS with Firebase Crashlytics. I'm remote building from VS2022 on PC to a mac mini, but the error 13 is the same.

It seems to be looking for the "GoogleService-Info.plist" file in the wrong place (certainly for a MAUI project). And a quick check in the .targets file confirms this.

On the mac, the root build for my project is here: "/Users/mark/Library/Caches/Xamarin/mtbs/builds/MauiTest//"

And this is where it is looking for the plist,

The actual place where the plist is for MAUI appears to be here: "/Users/mark/Library/Caches/Xamarin/mtbs/builds/MauiTest//bin/Debug/net6.0-ios/ios-arm64/device-builds/iphone13.1-16.5.1/MauiTest.app"

Maybe this is another one of those things that works properly for a standard Xamarin project, but not for MAUI.

As a poor work-around I've duplicated my plist into the root of the project with "MauiAsset" build type and this "fixes" the problem but obviously isn't a great solution.

Soap-141 commented 10 months ago

Same issue.

alvindutt commented 2 months ago

Hi is there any resolution to this issue ?

svaldetero commented 2 months ago

Hi is there any resolution to this issue ?

Easiest workaround is just putting it at the root of the project. I've been doing that with all my met net6, net7, and net8 projects.

<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
    <BundleResource Include="GoogleService-Info.plist" Link="GoogleService-Info.plist" />
</ItemGroup>