-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
AOT - Cannot use System.Reflection on type named AktifBarkod.AktifPOS.Mobil.EkranDiğer.Ana.AnaPage
#78638
Comments
Same issue here. I have updated to .net 7 to see if it solves the problem but apk still crashes |
Try without Turkish characters |
I am getting the same issue with my .net Maui signed app. Has there been any other feedback or way around this? |
That seems work for my case. Thanks |
nP |
AktifBarkod.AktifPOS.Mobil.EkranDiğer.Ana.AnaPage
Moving this to dotnet/runtime, for them to look at it. |
Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection Issue DetailsDescriptionI have published a .NET Maui app it is working on emulators but not working on real devices. By the way, I have tested 5 different real device. When trimming and AOT is disabled it works but incredibly slow and sluggish.There is a apk file I have uploaded for testing, you can download it to your devices and emulators also. The only log output I can find is below from a real device:
Real device video_2022-11-11_21-27-24.mp4Emulator 2022-11-11.21-37-47.mp4PS: Steps to ReproduceLink to public reproduction project repositoryThis is a private repo. Version with bugUnknown/Other (please specify) Last version that worked wellUnknown/Other Affected platformsAndroid Affected platform versionsAll android versions Did you find any workaround?no Relevant log outputNo response
|
cc @ivanpovazan @jandupej : please investigate. |
@sencagri could you please provide versions of dotnet and MAUI you were using?
@VictorCanovasA does it crash with the same exception? |
@alrit-solutions thank you for the update. Does this mean there is no crash on a device with original naming: |
We are not working together. |
@sencagri I see, thank you for your input. I will try to reproduce the issue and come back to you. |
Hey thanks. |
It seems to be an issue specific to XAML. I have types in my MAUI project with Norwegian letter å, but only those used in XAML causes this problem for me. Other ones work fine. I had to rename a viewmodel and some pocos which where being databound in XAML. |
@espenrl can you try disabling XAML compilation? https://learn.microsoft.com/en-us/dotnet/maui/xaml/xamlc?view=net-maui-7.0#disable-compilation If that solves your problem, we should move this back to dotnet/maui. |
These results are from release builds deployed by cable through latest VS Preview to a Samsung S22. With XAML compilation set to skip at assembly level the app crashes at startup. And I don't get an error message because of the release build. With XAML compilation set to skip at the page level I get a different error message. Please see the exceptions below.
Before applying XAML compilation skip.
With [XamlCompilation (XamlCompilationOptions.Skip)] at page level.
|
@espenrl it looks like you can disable XamlC completely with: <PropertyGroup>
<MauiXamlCValidateOnly>true</MauiXamlCValidateOnly>
</PropertyGroup> That should prevent it from writing assemblies with Mono.Cecil at all. Does that change anything? |
I tried it and the app still crashes upon startup. |
If you are using compile to call change from compile to skip I had the same error this is how I was able to fix it. |
Thank you all for the provided input. The repro steps are as follows.. Dotnet and MAUI versions:
Create, build and run the following application:
[AttributeUsage(AttributeTargets.Class)]
public class TestingAttribute : Attribute
{
public Type Type {get; private set;}
public TestingAttribute(Type type)
{
Type = type;
}
}
[Testing(typeof(EkranDiğer))]
public class ATestingClass
{
public ATestingClass(){}
}
public class EkranDiğer{}
public static MauiApp CreateMauiApp()
{
var attr = (TestingAttribute) Attribute.GetCustomAttribute(typeof(ATestingClass), typeof (TestingAttribute));
Console.WriteLine($"CreateMauiApp started {attr.Type}");
var builder = MauiApp.CreateBuilder();
...
I also confirmed that the problem is not present on iOS platforms.
I will continue investigating. |
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes dotnet#82187 Fixes dotnet#78638
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes #82187 Fixes #78638
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes dotnet/runtime#82187 Fixes dotnet/runtime#78638
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes dotnet/runtime#82187 Fixes dotnet/runtime#78638
Backport of dotnet/runtime#83273 to mono/mono `main` The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Contributes to dotnet/runtime#82187 Contributes to dotnet/runtime#78638
Backport of dotnet/runtime#83273 to mono/mono `2020-02` The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Contributes to dotnet/runtime#82187 Contributes to dotnet/runtime#78638
* [mono] Use `unsigned char` when computing UTF8 string hashes The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes #82187 Fixes #78638 * [aot] add DEBUG_AOT_NAME_TABLE code for debugging the class names AOT compiler: Emits a second "class_name_table_debug" symbol that has all the class names and hashes as strings. AOT runtime: warns if a class is not found in the name cache * Add regression test
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes #82187 Fixes #78638
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes dotnet#82187 Fixes dotnet#78638
…hes (#83303) * [mono] Use `unsigned char` when computing UTF8 string hashes The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes #82187 Fixes #78638 * Add regression test --------- Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
…es (#83302) * [mono] Use `unsigned char` when computing UTF8 string hashes The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes #82187 Fixes #78638 * Add regression test
Description
I have published a .NET Maui app it is working on emulators but not working on real devices. By the way, I have tested 5 different real device.
When trimming and AOT is disabled it works but incredibly slow and sluggish.
There is a apk file I have uploaded for testing, you can download it to your devices and emulators also.
https://aktifbarkod.com/d just go and download apk file. ( There is a only one apk file )
The only log output I can find is below from a real device:
Real device
video_2022-11-11_21-27-24.mp4
Emulator
2022-11-11.21-37-47.mp4
PS:
Steps to Reproduce
Link to public reproduction project repository
This is a private repo.
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
All android versions
Did you find any workaround?
no
Relevant log output
No response
The text was updated successfully, but these errors were encountered: