Example messages (メッセージの例)
warning XA1028: The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.
error XA1011: Using ProGuard with the D8 DEX compiler is no longer supported. Please set the code shrinker to 'r8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidLinkTool' MSBuild property to 'r8'.
問題点
プロジェクトは現在、D8 DEX コンパイラを使用するように構成されており、古いAndroidEnableProguard
MSBuild プロパティは、新しいAndroidLinkTool
MSBuild プロパティに値を設定せずにtrue
に設定されています。 ProGuard コード シュリンダーが D8 DEX コンパイラと互換性を持たなくなったため、 XA1011 エラーが発生します。
解決策
Visual Studio または別のテキスト エディターでプロジェクト ファイルを編集し、古い
<AndroidEnableProguard>
要素をすべて削除します。プロジェクト ファイルを保存した後、Visual Studio で通常どおり開き、Visual Studio プロジェクトのプロパティ ページの Code shrinker を r8 に設定するか、テキスト エディターでプロジェクト ファイルの編集を続行して、msBuild プロパティ
AndroidLinkTool
をr8
に設定します。<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AndroidLinkTool>r8</AndroidLinkTool> </PropertyGroup>
R8 では、ProGuard と比較して新しいビルドの警告やエラーが発生する場合があるため、プロジェクトの ProGuard ルールでは、この変更後に表示される新しい警告やエラーを解決するために、いくつかの更新が必要になる場合があります。