簡體   English   中英

使用 MAUI 支持舊版本 iOS

[英]Supporting Older iOS Version with MAUI

我們一直在開發一個應用程序,我使用的是最新的 .NET 7 和最新的 Xcode (14.1) 該應用程序僅適用於 ios 16 或更高版本,但不適用於 14.2 或 15.5 等舊版本。

我將 Xcode 降級為 13.4.1 並將 VS 降級為 17.3(我在問題末尾添加了版本詳細信息)

但我仍然有 Microsoft.ios 16.1.229 並且我明白,它作為工作負載工作,但我無法降級它。 我現在也在用 .NET 6.0

不幸的是我什至無法編譯項目。 我收到以下警告和錯誤。

/.../Platforms/iOS/Helpers/AppleDevicePermissions.cs(102,18): warning CA1416: This call site is
reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later.
'UIUserNotificationSettings.Types.get' is unsupported on: 'ios' 10.0 and 
 later, 'maccatalyst' 10.0 and later.
/...../Platforms/iOS/Helpers/AppleDevicePermissions.cs(102,18): warning CA1416: This call site is 
reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later
'UIApplication.CurrentUserNotificationSettings.get' is unsupported on: 'ios' 10.0 and later,'maccatalyst'
10.0 and later. [/..../MyApp.csproj]
ILLINK : warning MT0079: The recommended Xcode version for Microsoft.iOS 16.1.229 is Xcode 14.1 or later. 
The current Xcode version (found in /Applications/Xcode.app/Contents/Developer) is 13.4.1.
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.1.229/targets/Xamarin.Shared.Sdk.targets(1007,3): 
error : Failed to AOT compile Microsoft.Maui.dll, the AOT compiler exited with code 1 [/../MyApp.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.1.229/targets/Xamarin.Shared.Sdk.targets(1007,3): 
error : Failed to AOT compile Microsoft.Maui.Controls.dll, the AOT compiler exited with code 1 
[/....../MyApp.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.1.229/targets/Xamarin.Shared.Sdk.targets(1007,3):
error : Failed to AOT compile CommunityToolkit.Maui.Core.dll, the AOT compiler exited with code 1 
[/...../MyApp.csproj]

  Visual Studio Professional 2022 for Mac
Version 17.3 (build 2102)
Installation UUID: 29d662e6-697b-4c96-a0cc-d9c2773c0a95

Runtime
.NET 6.0.5 (64-bit)
Architecture: X64

Roslyn (Language Service)
4.3.0-3.22312.2+52adfb8b2dc71ed4278debcf13960f2116868608

NuGet
Version: 6.2.1.2

.NET SDK (x64)
SDK: /usr/local/share/dotnet/sdk/6.0.400/Sdks
SDK Versions:
    6.0.400
    3.1.422
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    6.0.8
    3.1.28

Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 13.0.0.0 (Visual Studio Professional)
Commit: xamarin-android/d17-3/030cd63
Android SDK: /Users/user/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        12.0 (API level 31)
        11.0 (API level 30)
        13.0 (API level 33)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 33.0.2
SDK Build Tools Version: 33.0.0

Build Information: 
Mono: dffa5ab
Java.Interop: xamarin/java.interop/d17-3@7716ae53
SQLite: xamarin/sqlite/3.38.5@df4deab
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@14076a6

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.3.0.23
Hash: 965bf40
Branch: remotes/origin/d17-3
Build date: 2022-08-03 21:18:42 UTC

Android Device Manager
Version: 0.0.0.1169
Hash: fafb1d5
Branch: fafb1d5
Build date: 2022-08-03 21:18:42 UTC

Apple Developer Tools
Xcode 13.4.1 (20504)
Build 13F100

Xamarin.Mac
Version: 8.12.0.2 (Visual Studio Professional)
Hash: 87f98a75e
Branch: d17-3
Build date: 2022-07-25 20:18:54-0400

Xamarin.iOS
Version: 15.12.0.2 (Visual Studio Professional)
Hash: 87f98a75e
Branch: d17-3
Build date: 2022-07-25 20:18:55-0400

Xamarin Designer
Version: 17.3.0.208
Hash: 0de472ea0
Branch: remotes/origin/d17-3
Build date: 2022-08-03 21:18:36 UTC

Build Information
Release ID: 1703002102
Git revision: 7a27f71b7aeb9b846940c9f8994c9ef7a694f0c2
Build date: 2022-08-03 21:16:13+00
Build branch: release-17.3
Build lane: release-17.3

Operating System
Mac OS X 12.6.0
Darwin 21.6.0 Darwin Kernel Version 21.6.0
    Mon Aug 22 20:17:10 PDT 2022
    root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64

更新:我將 VS 和 Xcode 更新到最新版本,但出現此錯誤

/...../MyApp/Platforms/iOS/Info.plist: Error: Info.plist (11) 中的 MinimumOSVersion 值與項目文件中的 SupportedOSPlatformVersion 值 (16.1) 不匹配(如果沒有 SupportedOSPlatformVersion 值在項目文件中,則采用默認值)。 更改 Info.plist 中的值以匹配 SupportedOSPlatformVersion 值,或者刪除 Info.plist 中的值(如果 SupportedOSPlatformVersion 值尚不存在,則將其添加到項目文件中)。 (MyAppApp) –

這是 thing info.plist 中的相關設置

問題已經解決了。 感謝@HAH 和他的想法。 我降級了所有版本,但問題不在於版本。

正如他分享的鏈接https://learn.microsoft.com/en-us/do.net/maui/supported-platforms?view.net-maui-7.0

maui 支持 ios 11 及更高版本

所以我將我的 VS 和 Xcode 更新到最新版本。

然后我創建了一個全新的maui APP並打開它的csproj文件並與我的進行了比較。 我從我的 csproje 文件中刪除了不必要的標簽,然后 voilà。 我可以編譯這個項目並將它部署到一個舊的 iPhone 上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM