다음을 통해 공유


Android용 .NET 오류 XA1011

예제 메시지

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'.

문제

이 프로젝트는 현재 ProGuard 코드 축소자와 함께 D8 DEX 컴파일러를 사용하도록 구성되었습니다. 이전에는 D8 DEX 컴파일러와 함께 ProGuard 코드 축소기를 사용할 수 있었지만 지금은 D8 DEX 컴파일러에서 R8 코드 축소기만 사용할 수 있습니다.

솔루션

Visual Studio 프로젝트 속성 페이지의 코드 축소기를 r8설정하거나 Visual Studio 또는 다른 텍스트 편집기에서 프로젝트 파일을 편집하고 MSBuild 속성을 다음으로 r8설정합니다AndroidLinkTool.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  <AndroidLinkTool>r8</AndroidLinkTool>
</PropertyGroup>

경우에 따라 R8은 ProGuard에 비해 새 빌드 경고 또는 오류를 생성할 수 있으므로 프로젝트에 대한 ProGuard 규칙은 이 변경 후에 나타나는 새 경고 또는 오류를 해결하기 위해 몇 가지 업데이트가 필요할 수 있습니다.