Код: Выделить всё
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : clang exited with code 1: [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : In file included from /Users/user/Projects/cds-tims-mobile-client/obj/Debug/net8.0-ios/ios-arm64/linker-cache/registrar.mm:3: [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : /Users/user/Projects/cds-tims-mobile-client/obj/Debug/net8.0-ios/ios-arm64/linker-cache/registrar.h:257:43: warning: 'retain (or strong)' attribute on property 'window' does not match the property inherited from 'UIApplicationDelegate' [-Wproperty-attribute-mismatch] [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : 257 | @property (nonatomic, assign) UIWindow * window; [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : | ^ [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : /Users/user/Projects/cds-tims-mobile-client/obj/Debug/net8.0-ios/ios-arm64/linker-cache/registrar.h:289:43: warning: 'retain (or strong)' attribute on property 'window' does not match the property inherited from 'UIApplicationDelegate' [-Wproperty-attribute-mismatch] [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : 289 | @property (nonatomic, assign) UIWindow * window; [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : | ^ [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/targets/Xamarin.Shared.Sdk.targets(1455,3): error : /Users/user/Projects/cds-tims-mobile-client/obj/Debug/net8.0-ios/ios-arm64/linker-cache/regist [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
9 Warning(s)
1 Error(s)
Код: Выделить всё
warning: 'retain (or strong)' attribute on property 'window' does not match the property inherited from 'UIApplicationDelegate' [-Wproperty-attribute-mismatch] [/Users/user/Projects/cds-tims-mobile-client/TIMS.csproj]
Код: Выделить всё
using Foundation;
using UIKit; // Add this to resolve UIWindow
namespace TIMS;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
[Export("window")]
public override UIWindow? Window { get; set; }
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Код: Выделить всё
[Export("window")]
public override UIWindow? Window { get; set; }
Код: Выделить всё
SdkOnly
Буду очень признателен за любую помощь.
РЕДАКТИРОВАТЬ:
После дальнейшего тестирования я не уверен, был ли я на правильном пути. Я изменил класс делегата своего приложения, чтобы он выглядел следующим образом:
Код: Выделить всё
using Foundation;
namespace TIMS;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Я немного изучил это, и моя проблема, похоже, заключается в следующем:
Атрибут моего свойства окна (неатомарный, присваиваемый) не соответствует ожидаемому UIApplicationDelegate (сохраненному или сильному). Строка @property (nonatomic, Assign) UIWindow * window; находится в автоматически создаваемом заголовочном файле Objective-C (registrar.h), который создается в процессе сборки в Xamarin или .NET MAUI. iOS-проект. Это часть кода взаимодействия Objective-C, созданного цепочкой инструментов Xamarin.iOS или .NET MAUI, которая отвечает за маршалинг между C# и Objective-C во время сборки.
Поэтому я нужно найти способ заставить мой AppDelegate генерировать строку @property (nonatomic, Strong) UIWindow * window; вместо @property (nonatomic, Assign) UIWindow * window;.
Подробнее здесь: https://stackoverflow.com/questions/790 ... -match-pro
Мобильная версия