Hello,
Since you are using DependencyService
, this error is expected.
This feature has been deprecated in MAUI and replaced by dependency injection.
For dependency injection, you need to call the service component that has been registered with the application in the following way:
var settingsService = this.Handler.MauiContext.Services.GetServices<ISettingsService>();
Please refer to Dependency injection - Resolution for more detailed information.
Based on this known GitHub issue Build Action: BundleResource does not exist. #7938, there are two ways you could fix this issue.
<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
<MauiAsset Include="Platforms\iOS\GoogleService-Info.plist" LogicalName="GoogleService-Info.plist" />
</ItemGroup>
Or
<ItemGroup>
<BundleResource Include="Platforms\iOS\GoogleService-Info.plist" Link="GoogleService-Info.plist" />
</ItemGroup>
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.