iosadmobmaui

Maui error on iOS from MTAdmob implementation: clang++ exited with code 1


Trying to implement Admob on Maui app (newly converted from Xamarin) using MTAdmob Plugin. Works fine on Android, but getting the following error on iOS. I'm confident that this plugin/ads are causing the error because I can build no problem when I delete the package.

Anyone have any insight on this error? Seems to be coming from the UserMessagingPlatform package, but this package is what's installed in the sample at the link above. Also, deleting the UserMessagingPlatform package does not get rid of the error on build.

I'm developing in VS for Windows and pairing to Mac for the iOS simulator.

Error:

clang++ exited with code 1:ld: in /Users/MyUsername/Library/Caches/Xamarin/mtbs/builds/MyMauiApp/02b2e598cb2d297dae247439d1eb22d4a6d0f9fcdb24b3f87159ce66eb0c1c18/C:/Users/MyUsername /AppData/Local/XamarinBuildDownloadCache/GUsrMess-1.1.0/Frameworks/Release/UserMessagingPlatform.framework/UserMessagingPlatform(UMPView.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/MyUsername /Library/Caches/Xamarin/mtbs/builds/MyMauiApp/02b2e598cb2d297dae247439d1eb22d4a6d0f9fcdb24b3f87159ce66eb0c1c18/C:/Users/MyUsername/AppData/Local/XamarinBuildDownloadCache/GUsrMess-1.1.0/Frameworks/Release/UserMessagingPlatform.framework/UserMessagingPlatform' for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)

Installed packages:

<ItemGroup>
    <PackageReference Include="CommunityToolkit.Maui" Version="9.0.2" />
    <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
    <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
    <PackageReference Include="Plugin.MauiMTAdmob" Version="1.4.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
    <PackageReference Include="Xamarin.Google.iOS.MobileAds" Version="8.13.0.3" />
    <PackageReference Include="MT.Xamarin.Google.iOS.UserMessagingPlatform" Version="1.1.0.4" />
</ItemGroup>

Solution

  • Deleting obj & bin folders and cleaning solution got rid of the error