Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recycler view (and other androidx controls) shows error in .xml preview #923

Open
TobiasLenander01 opened this issue Jul 16, 2024 · 2 comments

Comments

@TobiasLenander01
Copy link

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

VS 2022 .NET 8.0

Description

I expected to see a preview of the recycler view but instead an error message shows up: java.lang.NullPointerReference. It only shows in the xml preview initially. However, I also get "This project contains resources that were not compiled successfully, rendering might be affected" after closing and reopening the project in visual studio. I have also tried other controls from the androidx library and the same thing happens.

Please see the video below
https://github.com/user-attachments/assets/1575f431-d88f-4b54-b839-d182aeab33f6

Steps to Reproduce

  1. Create new .NET android app
  2. Install androidx from nuget
  3. Add androidx control to activity_main.xml (in this case recycler view)
  4. See error message in the xml preview. No errors in the error list.

Did you find any workaround?

No response

Relevant log output

'Binary XML file line #1 in com.companyname.ToDo:layout/activity_main: Binary XML file line #1 in com.companyname.ToDo:layout/activity_main: Error inflating class androidx.recyclerview.widget.RecyclerView'
@jpobst
Copy link
Contributor

jpobst commented Jul 17, 2024

Try performing a full build after you add the NuGet to the project. I think the designer requires some things to be built before it will work.

@TobiasLenander01
Copy link
Author

Thanks for your suggestion but I have already tried this. It doesn't help sadly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants