0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MAUI Tips - AOTCompileエラーが出た場合の対処方法

Posted at

概要

アップデートによってビルドが通らなくなることがよくある.NET MAUIさん。
どこぞの投稿にも、自動アップデートは止めておこうという記載があった💦
それはさておき、片っ端からアップデートしてたら、ビルドが通らなくなった時に起こったエラーと
その時の対処方法を備忘のために記録。

起きた現象

何をどこまでどうアップデートかけたか定かでないんですが、
IPAファイルをプロビジョニングしようと思ったら大量のエラーが吐き出される。

1行目のエラーはこんな感じ。

usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.5/17.5.8030/targets/Xamarin.Shared.Sdk.targets(1270,3): error MSB4018: "AOTCompile" タスクが予期せずに失敗しました。 [/Users/XXXXXXXX/Projects/XXX/XXX/XXX.csproj::TargetFramework=net8.0-ios]

AOTCompile・・・って???
検索してもそれらしい解決策が見つからず・・・。

2行目のエラーはこんな感じ。
めちゃ長い・・・。
やたらとOne or more errors occurred.が表示されてる。
けど、よく見ると、No such file or directoryという文言が。

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.5/17.5.8030/targets/Xamarin.Shared.Sdk.targets(1270,3): error MSB4018: System.AggregateException: One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (An error occurred trying to start process '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/8.0.7/Sdk/../tools/mono-aot-cross' with working directory '/Users/XXXXXXXX/Projects/XXX/XXX'. No such file or directory))) (One or more errors occurred. (One or more errors occurred. (An error occurred trying to start process '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/8.0.7/Sdk/../tools/mono-aot-cross' with working directory '/Users/XXXXXXXX/Projects/XXX/XXX'. No such file or directory))) (One or more errors occurred. (One or more errors occurred. (An error occurred trying to start process '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/8.0.7/Sdk/../tools/mono-aot-cross' with working directory '/Users/XXXXXXXX/Projects/XXX/XXX'. No such file or directory))) (One or more errors occurred. (One or more errors occurred. (An error occurred trying to start process '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/8.0.7/Sdk/../tools/mono-aot-cross' with working directory '/Users/XXXXXXXX/Projects/XXX/XXX'. No such file or directory))) [/Users/XXXXXXXX/Projects/XXX/XXX/XXX.csproj::TargetFramework=net8.0-ios]

該当フォルダを見てみると、確かに8.0.7のフォルダがない。
代わりに8.0.8のフォルダはある。

.NET Coreのランタイムのインストールリストを見ると

.NET Core Runtimes:
  8.0.7   (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  7.0.9   (arm64)              
  7.0.20  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  7.0.13  (arm64)              
  7.0.10  (arm64)              
  7.0.1   (arm64)              
  6.0.32  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  6.0.24  (arm64)              
  6.0.21  (arm64)              
  6.0.20  (arm64)  
  6.0.12  (arm64) 

8.0.8がない。
バージョンの不整合が起きている?

実施したこと

ということで、.NETの最新版を再インストールしてみる。
以下のURLからダウンロード
https://dotnet.microsoft.com/ja-jp/download

再度プロビジョニングしたところ、無事IPAファイルが生成できました!

余談

エラーは1行目だけじゃなくて2行目以降もちゃんと読もうね💦

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?