首先,我使用 Windows 10 和 VisualStudio 2022 開發 Xamarin.IOS 專案,我從 Visual Studio 連接到我的 Mac。我的 Mac 運行 MacOS 10.15.7 和 Xcode 12.4,我無法安裝更新版本的 MacOS,因為我的 Mac 不支持更新版本。
當我使用 Visual Studio 連接到我的 Mac 時,它說 Xamarin 與 Xcode 12.4 不兼容,請安裝 12.5 或更高版本。版本 12.4 可能會導致意外警告或錯誤。
然后我只需單擊“確定”并連接。當我想構建我的應用程式時,它說:
/Users/xxxx/Library/Caches/Xamarin/mtbs/builds/RetailApplication.iOS/d967d3a2c8371f3518eeb13eb0586ef2298912b5e49700e0a350cef56add41d4/Assets.xcassets/AppIcon.appiconset/Icon1024.png. 當我添加一個名為 Assets 的 AssetCatalog 和一個名為 AppIcon 的 Iconset,其中包含一個名為 Icon1024.png 的檔案時,錯誤消失了。因為圖示被復制到我 mac 上的這個確切路徑。
但現在我的錯誤資訊是File not found: /Users/xxxx/Library/Caches/Xamarin/mtbs/builds/RetailApplication.iOS/d967d3a2c8371f3518eeb13eb0586ef2298912b5e49700e0a350cef56add41d4/Assets.xcassets/AppIcon.appiconset/_/114.png。
我完全不知道我應該如何將這樣呼叫的檔案放入名為的子檔案夾_中以及為什么會發生錯誤。我從來沒有在我的專案中的任何地方指定 114.png 。
現在我想知道這是否會因為我的 Xcode 版本過時而發生。因為我無法更新我的 Xcode,所以我想知道我是否可以降級我的 Xamarin.IOS 版本。因為 Xamarin 版本 14.17 兼容 Xcode 12.4 https://learn.microsoft.com/de-de/xamarin/ios/release-notes/14/14.17
但 Xamarin 版本 14.19 需要 Xcode 12.5 https://learn.microsoft.com/de-de/xamarin/ios/release-notes/14/14.19
uj5u.com熱心網友回復:
您可以檢查您的資產目錄配置,右鍵單擊您的 ios 專案 > 卸載專案 > 并編輯 csproj 檔案。向下滾動查看是否有包含內容的 ItemGroup 'Assets.xcassets/AppIcon.appiconset/_/114.png',找到并洗掉它,然后重新加載 csproj,Clean,Rebuild。(您可能必須洗掉當前的資產目錄,創建一個新目錄并重新分配您的圖示和啟影片面)。
不建議將新的 Xamarin.iOS 與舊的 Xcode 一起使用。會有一些潛在的挑戰。更多細節可以參考官方檔案:Can I use an older version of Xcode or Xamarin.iOS? | 微軟
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/534863.html
標籤:ios代码赛马林
