示例消息
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'.
Issue
The project is currently configured to use the D8 DEX compiler in combination with the ProGuard code shrinker. In the past, using the ProGuard code shrinker with the D8 DEX compiler was allowed, but now, only the R8 code shrinker is supported for use with the D8 DEX compiler.
解决方案
Set the Code shrinker in the Visual Studio project properties pages to r8, or edit the project file in Visual Studio or another text editor and set the AndroidLinkTool MSBuild property to r8:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AndroidLinkTool>r8</AndroidLinkTool>
</PropertyGroup>
在某些情况下,R8 可能会生成与 ProGuard 相比的新生成警告或错误,因此项目的 ProGuard 规则可能需要一些更新来解决此更改后出现的任何新警告或错误。