Skip to content

.net Maui iOS BundleResource Missing / Not Working #8301

@epsmae

Description

@epsmae

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-single-projectSplash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizerplatform/ioss/needs-verificationIndicates that this issue needs initial verification before further triage will happent/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions