maui icon indicating copy to clipboard operation
maui copied to clipboard

System.FieldAccessException: Field `Microsoft.Maui.Controls.VisualElement:ZIndexProperty' is inaccessible

Open anherukun opened this issue 1 year ago • 1 comments

Description

I'm deploying a Release version for android app, and i get this message error System.FieldAccessException: Field `Microsoft.Maui.Controls.VisualElement:ZIndexProperty' is inaccessible`

Also i'm trying with debugger but this error doesn't appears, every works fine

Steps to Reproduce

  1. Create MAUI app project with .net 6 framework
  2. In XAML editor add the property ZIndex with any value
  3. Choose Release deployment
  4. Compile and run (Emulator or Physical device indistinct)

Optional: Use device logger to identify the exception

Link to public reproduction project repository

https://github.com/anherukun/zindexerrorexample

Version with bug

7.0 (current)

Last version that worked well

7.0 (current)

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 11 (Tested)

Did you find any workaround?

Not using Zindex, but rather positioning the objects in reverse order in the XAML Editor

Relevant log output

No response

anherukun avatar Mar 10 '23 19:03 anherukun

@anherukun Does the error occur if you update to .NET 7?

hartez avatar Mar 10 '23 22:03 hartez

Duplicate of https://github.com/dotnet/maui/issues/7331

mattleibow avatar Mar 13 '23 16:03 mattleibow

Hi @anherukun. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Mar 13 '23 16:03 ghost

image

I'm using MAUI 7.0.59

anherukun avatar Mar 14 '23 20:03 anherukun

Steps to Reproduce

  1. Create MAUI app project with .net 6 framework

Does the problem occur if you create your project with the .NET 7 framework?

hartez avatar Mar 14 '23 21:03 hartez

My mistake. I'm tested with .net 7 and it works fine

anherukun avatar Mar 21 '23 01:03 anherukun