1

I have been struggling with a problem starting my MAUI app for two days now. The structure of the app should be normal, so I'm surprised that I haven't found anyone else with the same problem.

The app consists of a multiplatform MAUI frontend (.NET8.0 - IOS, Android, Mac), a core library (.NET8.0), a firebase library (.NET8.0) and the respective test projects (.NET8.0). Apparently the app cannot cope with the different target frameworks of the projects, because the error has only occurred since I split the app into different projects to test them better.

The dotnet build is successful, but when I start the app with the following command, I get the following errors:

dotnet build MyMauiApp.sln -t:Run -f net8.0-ios -p:_DeviceName=:v2:udid=16A1C6AA-DC20-4CB6-BB69-AEA5B7D0D47B

/usr/local/share/dotnet/sdk/8.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Die Ressourcendatei "/Users/tomfuchs/Repositories/MyMauiApp/MyMauiApp.FirebaseClient/obj/project.assets.json" weist kein Ziel für "net8.0-ios" auf. Stellen Sie sicher, dass die Wiederherstellung ausgeführt wurde, und dass Sie "net8.0-ios" in die TargetFrameworks für Ihr Projekt eingeschlossen haben. [/Users/tomfuchs/Repositories/MyMauiApp/MyMauiApp.FirebaseClient/MyMauiApp.FirebaseClient.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.5/17.5.8020/tools/msbuild/iOS/Xamarin.Shared.targets(620,3): error : A bundle identifier is required. Either add an 'ApplicationId' property in the project file, or add a 'CFBundleIdentifier' entry in the project's Info.plist file. [/Users/tomfuchs/Repositories/MyMauiApp/MyMauiApp.Core.Test/MyMauiApp.Core.Test.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.5/17.5.8020/tools/msbuild/iOS/Xamarin.Shared.targets(620,3): error : A bundle identifier is required. Either add an 'ApplicationId' property in the project file, or add a 'CFBundleIdentifier' entry in the project's Info.plist file. [/Users/tomfuchs/Repositories/MyMauiApp/MyMauiApp.FirebaseClient.Test/MyMauiApp.FirebaseClient.Test.csproj]
/usr/local/share/dotnet/sdk/8.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Die Ressourcendatei "/Users/tomfuchs/Repositories/MyMauiApp/MyMauiApp.Core/obj/project.assets.json" weist kein Ziel für "net8.0-ios" auf. Stellen Sie sicher, dass die Wiederherstellung ausgeführt wurde, und dass Sie "net8.0-ios" in die TargetFrameworks für Ihr Projekt eingeschlossen haben. [/Users/tomfuchs/Repositories/MyMauiApp/MyMauiApp.Core/MyMauiApp.Core.csproj]

Here are the .csproj

MAUI-Project

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.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);net8.0-tizen</TargetFrameworks> -->

        <!-- Note for MacCatalyst:
        The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
        When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
        The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
        either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
        <!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

        <OutputType Condition= "'$(TargetFramework)' != 'net8.0'">Exe</OutputType>
        <RootNamespace>MyMauiApp</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>

        <!-- Display name -->
        <ApplicationTitle>MyMauiApp</ApplicationTitle>

        <!-- App Identifier -->
        <ApplicationId>com.companyname.mymauiapp</ApplicationId>

        <!-- Versions -->
        <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
        <ApplicationVersion>1</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
        <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
    </PropertyGroup>

    <ItemGroup>
        <!-- App Icon -->
        <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

        <!-- Splash Screen -->
        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

        <!-- Images -->
        <MauiImage Include="Resources\Images\*" />
        <MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

        <!-- Custom Fonts -->
        <MauiFont Include="Resources\Fonts\*" />

        <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
        <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
        <PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
    </ItemGroup>

    <ItemGroup>
      <ProjectReference Include="..\MyMauiApp.FirebaseClient\MyMauiApp.FirebaseClient.csproj">
        <TargetFramework>net8.0</TargetFramework>
      </ProjectReference>
      <ProjectReference Include="..\MyMauiApp.Core\MyMauiApp.Core.csproj">
        <TargetFramework>net8.0</TargetFramework>
      </ProjectReference>
    </ItemGroup>

</Project>

Core-Project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
      <IsPackable>false</IsPackable>
      <ExcludeAssets>runtime</ExcludeAssets>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
  </ItemGroup>

</Project>

Core-Test-Project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <IsPackable>false</IsPackable>
    <IsTestProject>true</IsTestProject>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
      <IsPackable>false</IsPackable>
      <ExcludeAssets>runtime</ExcludeAssets>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
    <PackageReference Include="NUnit" Version="3.13.3" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
    <PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
    <PackageReference Include="coverlet.collector" Version="6.0.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyMauiApp.Core\MyMauiApp.Core.csproj" />
  </ItemGroup>

</Project>

FirebaseClient-Project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
      <IsPackable>false</IsPackable>
      <ExcludeAssets>runtime</ExcludeAssets>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
  </ItemGroup>

  <ItemGroup>
    <None Update="Resources\Config\apiconfig.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>


</Project>

FirebaseClient-Test-Project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <IsPackable>false</IsPackable>
    <IsTestProject>true</IsTestProject>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
      <IsPackable>false</IsPackable>
      <ExcludeAssets>runtime</ExcludeAssets>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
    <PackageReference Include="NUnit" Version="3.13.3" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
    <PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
    <PackageReference Include="coverlet.collector" Version="6.0.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyMauiApp.FirebaseClient\MyMauiApp.FirebaseClient.csproj" />
  </ItemGroup>

</Project>

I have already changed the respective files a bit, for example to prevent the start of side projects in .net8.0-ios. But so far without success.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.