I have .NET MAUI application in MacOS, working in Visual Studio 2022. When I'm building it in Debug mode it's working perfectly, but I cannot build it in release mode, I'm getting error.
Assets file '/Users/bliink/Documents/BLiiNK/BLiiNK/obj/project.assets.json' doesn't have a target for 'net7.0-maccatalyst/maccatalyst-arm64'. Ensure that restore has run and that you have included 'net7.0-maccatalyst' in the TargetFrameworks for your project. You may also need to include 'maccatalyst-arm64' in your project's RuntimeIdentifiers. (NETSDK1047)
I've tried to play with project configuration but unfortunately I didn't found the right one to compile my application without any error. Can you help me with this and give the hint to how resolve it?
UPD. It's a Mac Catalyst application and here is the list of all NuGet packages:
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.Maui" Version="2.0.0-beta.710" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="PInvoke.User32" Version="0.7.124" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.141-beta" />
<PackageReference Include="System.Management" Version="8.0.0-preview.4.23259.5" />
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
</ItemGroup>
UPD2. Here is the error log, which I get when I run the bundle in maccatalyst-arm64 folder after resolving the issue above, like Alexandar May - MSFT suggested.
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: TestApp [3684]
Path: /Users/USER/Documents/*/TestApp.app/Contents/MacOS/TestApp
Identifier: com.testapp.TestApp
Version: 2.1.4 (1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2023-12-09 17:00:11.4111 +0400
OS Version: macOS 14.1.2 (23B92)
Report Version: 12
Anonymous UUID: 64A2D3A6-74FA-1C35-D3DF-AFB84C4D008E
Sleep/Wake UUID: 4DB3887F-9027-4B32-A18D-16E0CC7CD222
Time Awake Since Boot: 14000 seconds
Time Since Wake: 6387 seconds
System Integrity Protection: enabled
Crashed Thread: 0 tid_103 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process: TestApp [3684]
-----------
Full Report
-----------
{"app_name":"TestApp","timestamp":"2023-12-09 17:00:25.00 +0400","app_version":"2.1.4","slice_uuid":"f7125eac-c00d-32c7-a7d3-6c3fd0b788af","build_version":"1","platform":6,"bundleID":"com.testapp.TestApp","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 14.1.2 (23B92)","roots_installed":0,"name":"TestApp","incident_id":"A0A2B50E-7826-4298-92CA-1BDBF53D8C6F"}
{
"uptime" : 14000,
"procRole" : "Foreground",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "MacBookPro18,1",
"coalitionID" : 3328,
"osVersion" : {
"train" : "macOS 14.1.2",
"build" : "23B92",
"releaseType" : "User"
},
"captureTime" : "2023-12-09 17:00:11.4111 +0400",
"codeSigningMonitor" : 1,
"incident" : "A0A2B50E-7826-4298-92CA-1BDBF53D8C6F",
"pid" : 3684,
"translated" : false,
"cpuType" : "ARM-64",
"roots_installed" : 0,
"bug_type" : "309",
"procLaunch" : "2023-12-09 17:00:03.1434 +0400",
"procStartAbsTime" : 338575444283,
"procExitAbsTime" : 338773533538,
"procName" : "TestApp",
"procPath" : "\/Users\/USER\/Documents\/*\/TestApp.app\/Contents\/MacOS\/TestApp",
"bundleInfo" : {"CFBundleShortVersionString":"2.1.4","CFBundleVersion":"1","CFBundleIdentifier":"com.testapp.TestApp"},
"storeInfo" : {"deviceIdentifierForVendor":"BE4C2045-5ABA-5E0F-981C-16F2CE6C5EF2","thirdParty":true},
"parentProc" : "launchd",
"parentPid" : 1,
"coalitionName" : "com.testapp.TestApp",
"crashReporterKey" : "64A2D3A6-74FA-1C35-D3DF-AFB84C4D008E",
"codeSigningID" : "com.testapp.TestApp",
"codeSigningTeamID" : "",
"codeSigningFlags" : 570425857,
"codeSigningValidationCategory" : 10,
"codeSigningTrustLevel" : 4294967295,
"instructionByteStream" : {"beforePC":"fyMD1f17v6n9AwCRXOD\/l78DAJH9e8Go\/w9f1sADX9YQKYDSARAA1A==","atPC":"AwEAVH8jA9X9e7+p\/QMAkVHg\/5e\/AwCR\/XvBqP8PX9bAA1\/WcAqA0g=="},
"wakeTime" : 6387,
"sleepWakeUUID" : "4DB3887F-9027-4B32-A18D-16E0CC7CD222",
"sip" : "enabled",
"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
"termination" : {"flags":0,"code":6,"namespace":"SIGNAL","indicator":"Abort trap: 6","byProc":"TestApp","byPid":3684},
"asi" : {"libsystem_c.dylib":["abort() called"]},
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"sharedCache" : {
"base" : 6538444800,
"size" : 4018896896,
"uuid" : "6d1aeeac-d56f-3513-9ae1-3894fde828f3"
},
"legacyInfo" : {
"threadTriggered" : {
"name" : "tid_103",
"queue" : "com.apple.main-thread"
}
},
"logWritingSignature" : "b3a666d970e84e599ac2fea6bb49e737b4caa5de",
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "6112d17137f5d11121dcd4e2",
"factorPackIds" : {
},
"deploymentId" : 240000464
},
{
"rolloutId" : "60186475825c62000ccf5450",
"factorPackIds" : {
},
"deploymentId" : 240000068
}
]
}
}
Model: MacBookPro18,1, BootROM 10151.41.12, proc 10:8:2 processors, 16 GB, SMC
Graphics: Apple M1 Pro, Apple M1 Pro, Built-In
Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online
Memory Module: LPDDR5, Hynix
To fix the issue when building the .NET MAUI application in release mode, you can add the property group listed below to your csproj file:
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst'))">
<RuntimeIdentifier>maccatalyst-arm64</RuntimeIdentifier>
</PropertyGroup>