question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.net Maui iOS BundleResource Missing / Not Working

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
epsmaecommented, Jun 27, 2022

@PureWeen you moved the issue to xamarin but it works fine in xamarin forms.

The bundleResource is also required for the localization:

  <ItemGroup>
    <BundleResource Include="Resources\en.lproj\InfoPlist.strings" />
    <BundleResource Include="Resources\en.lproj\Localizable.strings" />
  </ItemGroup>
0reactions
rricarrdocommented, Jul 4, 2022

I believe the issue should be re-opened.

The BundleResource Build Action is available for net6.0-ios projects: image

The build action is just not available for the MAUI projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MAUI set build action to bundleresource - Microsoft Q&A
I am trying to work with Firestore, and I have this fully functioning in Xamarin Forms but this small thing is blocking me...
Read more >
Appicons "missing" in maui ios ipa file when uploading to ...
I am trying to upload my Maui app to app store connect. Consistently running into "Asset Validation Failed" for icon sizes 120x120, 167x167, ......
Read more >
New .Net MAUI App project throws 'The name ...
I've tried almost everything in this post The name 'InitializeComponent' does not exist in the current context which contains suggestions like ...
Read more >
NET MAUI Setup
NET MAUI Setup. How to install the Airship .NET module. We provide native binding packages for iOS and Android, and cross-platform .NET packages...
Read more >
Opinions on .NET MAUI / what do Xamarin Devs have to say
I'm using MAUI (Hybrid) now with Blazor (server) to create cross platform apps mobile, desktop, web. (Only missing Linux hope they support it)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found