-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RichTextKit/SkiaSharp on Android: Could not resolve type with token 0100000b from typeref (expected class 'System.ReadOnlySpan`1' in assembly 'mscorlib') #5142
Comments
Verified repro with Version 17.2.0 Preview 2.0 [32208.484.main] on Android and can works fine on Windwos. Sample project: #5142.zip |
I am wondering if you are using too old a SkiaSharp and RichTextKit? The latest version of vs brings maui p14 which is onky compatible with skia preview 232 |
@mattleibow I've just updated the repo project to use SkiaSharp.Views.Maui.Controls 2.88.0-preview.232 and still get the same error. The sample code is already running on the latest available version of RichTextKit, and the callstack at the point of error is:
Which is this line: shaped = shaper.Shape(_textShapingBuffers, codePoints, style, direction, codePoints.Start, asFallbackFor, ResolveTextAlignment()); However because the error is a type resolution error, I don't think that line is actually to blame. Looking at what's going on in the |
@mikegoatly have you resolved the issue ? The current project hierarchy is: So I tried referencing directly the nuget lib from it's source code. I tried on both VS windows and Rider windows. |
This is true, these people are planning to replace Xamarin with MAUI, yet MAUI is full of runtime bugs, mostly related to mscorlib. |
The reason for this error is because the build is pulling in an assembly that was compiled against monoandroid and that hits an issue with the compatibility shim, see my explanation here: dotnet/runtime#82193 (comment) The easiest solution is to add a |
…b.dll The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support. This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android. Fixes dotnet#82193 Should also fix dotnet/maui#5142, dotnet/maui#5078, dotnet/maui#3903
Hi @mikegoatly. 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. |
Verified this issue on Visual Studio Enterprise 17.6.0 Preview 3.0. This issue does not repro on Android emulator (13.0-API 33) with below Project: Uploading MauiRichTextKit.zip… |
Description
When running a MAUI project on Android using RichTextKit to render text on a SkiaSharp
SKCanvasView
control the following exception is thrown:Repo here: https://github.com/mikegoatly/MauiExperiments/tree/main/MauiRichTextKit
I'm guessing that code is being trimmed that's needed?
Steps to Reproduce
SkiaSharp.Views.Maui.Controls
.UseSkiaSharp()
toMauiProgram
MainPage.xaml
to have this as content:MainPage.xaml.cs
:Debug the app on Android (I'm using
Pixel 5 - API 30 (Android 11.0 - API 30)
) and get the error. Note that the app works fine when running as a Windows app.Version with bug
Preview 13 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11 and up
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: