ios – Can’t remove NewsstandKit from MAUI project


I have a MAUI project version: maui-ios 7.0.92/7.0.100, SDK 7.0.400. I am using xCode v15, macOS Sonoma 14.1.2, and VS for Mac 17.6.7.

I am trying to build an ex co-workers project but I keep getting this error:

In file included from ~~/cds-tims-mobile-client/obj/Debug/net7.0-ios/ios-arm64/linker-cache/registrar.mm:3:
~~/cds-tims-mobile-client/obj/Debug/net7.0-ios/ios-arm64/linker-cache/registrar.h:32:9: fatal error: 'NewsstandKit/NewsstandKit.h' file not found
#import <NewsstandKit/NewsstandKit.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated. (TIMS)

I have seen a lot of other questions trying to solve the same issue and I know it is an incompatibility issue with NewsstandKit and xCode 15. The problem is that even after removing all references from the project every time I try to build the project references to Newsstand kit are created in the registrar.h, registrar.m, and _LinkerFrameworks.items files which triggers the error.

I have seen other questions say to add <MtouchExtraArgs>--weak-framework=NewsstandKit.framework/NewsstandKit</MtouchExtraArgs> to the .csproj file but I have done this:

    <PropertyGroup>
        <TargetFrameworks>net7.0-ios;</TargetFrameworks>
        <RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
        <MtouchExtraArgs>--weak-framework=NewsstandKit.framework/NewsstandKit</MtouchExtraArgs>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
        <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
        <!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
        <OutputType>Exe</OutputType>
        <RootNamespace>TIMS</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>

Yet the error persists and the references keep getting generated.

There are also references to NewsstandKit inside Xamarin.iOS.dll.s but there are a ton. I’m not sure if I should just delete this file or what.

How can I get rid of this NewsstandKit package and make it stop generating in the registrar files? What is making this happen? Is NewsstandKit part of a bigger package I am using perhaps?

If you need any further information or to see any files or code please let me know.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img