Skip to content

Thrown an exception while enabling "AndroidUseAapt2" in application. #3123

Closed
@Iyyappanmani

Description

@Iyyappanmani

Steps to Reproduce

We have created the sample to reproduce the issue.
In our sample, we have created the one custom control that contains the layout from axml and it has been inflated in our library project.

In our application project, we have only added that custom control into the view and we are facing the below error at the time of enabling the AndroidUseAapt2 in our application.

Expected Behavior

It should run without any exception.

Actual Behavior

It has thrown the runtime exception as shown below.

Basic Information

  • Visual Studio Version: Both 2017 and 2019
  • Platform Target Frameworks:
    • Android: Xamarin.Android.SDK version 9.1.7.0
  • Android Support Library Version: 28.0.0.1

Screenshots

MicrosoftTeams-image (5)

Error log: Unhandled Exception:

Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class InflatedLibrary.CodeBehindClass occurred

Sample

Sample

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions