TobiasBuchholz / Plugin.Firebase

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

FCrshlytcs-10.24.0/upload-symbols.sh should use GoogleService-Info.plist from final package #339

Open spelletier opened 2 months ago

spelletier commented 2 months ago

For project with multiple GoogleService-Info.plist, the file used for upload-symbols.sh should be the one in the app package.

For example, in a projet with 2 app identifiers used in different build configurations, my csproj file contains these lines that select and copy the right file in the final app package.

<ItemGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
    <BundleResource Include="GoogleService-Info-Prod.plist" LogicalName="GoogleService-Info.plist"/>

<ItemGroup Condition="'$(Configuration)'=='Debug-Test' Or '$(Configuration)'=='Release-Test'">
    <BundleResource Include="GoogleService-Info-Test.plist" LogicalName="GoogleService-Info.plist"/>

During the build in a runner, I get this error: /Users/runner/.nuget/packages/adame.firebase.ios.crashlytics/10.24.0.2/buildTransitive/AdamE.Firebase.iOS.Crashlytics.targets(41,5): warning MSB3073: The command "'/Users/runner/Library/Caches/XamarinBuildDownload/FCrshlytcs-10.24.0/upload-symbols.sh' -gsp '/Users/runner/work/1/s/ProjectPath/GoogleService-Info.plist' -p ios '/Users/runner/work/1/s/PathToAppBundle.dSYM'" exited with code 13.

By replacing ProjectPath with PathToAppBundle, the script would always find the right file.

AdamEssenmacher commented 2 months ago

Could you open a PR at https://github.com/AdamEssenmacher/GoogleApisForiOSComponents ?

The file that would need to be modified is here: https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/blob/main/source/Firebase/Analytics/Analytics.targets

You could test your changes out locally by modifying that Analytics.targets directly in your nuget cache.

spelletier commented 2 months ago

Thank you for the hint to find out the file to change. Pull request sent.