Skip to content

BundleResource by default include to a nested directory, which can be confusing #8612

@chamons

Description

@chamons

From @PureWeen on Sat, 25 Jun 2022 15:53:08 GMT

Moved from #8301

Description

For firebase services the the "GoogleService-Info.plist" file build action has to be set as "BundleResource". The build action is not available in the visual studio selecten and also does not work when setting in the project file:

    <ItemGroup>
      <BundleResource  Include="Platforms\iOS\GoogleService-Info.plist" />
    </ItemGroup>

The following errror occurs when "Firebase.Core.App.Configure()" is called:
ObjCRuntime.ObjCException: 'Objective-C exception thrown. Name: com.firebase.core Reason: FirebaseApp.configure() could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/. Native stack trace:

Steps to Reproduce

  1. dotnet new maui
  2. Install nuget Xamarin.Firebase.iOS.CloudMessaging
  3. Add GoogleService-Info.plist file to Platforms/iOS
  4. Try to set build action
  5. Call Firebase.Core.App.Configure(); in AppDelegate
    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
        Firebase.Core.App.Configure();
        return base.FinishedLaunching(application, launchOptions);
    }

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

All

Did you find any workaround?

Yes the configuration can be set in code

Firebase.Core.App.Configure(new Options("1:7..4:ios:8..7", "7..4")
{
	ApiKey = "A.._W.._8.._g",
	ClientId = "...apps.googleusercontent.com",
	BundleId = "<<BUNDLE-ID>>",
	ProjectId = "<<ProjectId>>"
});

Relevant log output

No response

Copied from original issue dotnet/macios#15347

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-single-projectSplash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizerfixed-in-8.0.70fixed-in-9.0.0-preview.7.24407.4p/1Work that is important, and has been scheduled for release in this or an upcoming sprintplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions