I'am using version 31.1.21 and when i try to render a corrupted pdf and the popup in the photo is showed.
This is throw
16:55:38:856 [0:] Microsoft.Maui.FontManager: Warning: Unable to load font 'Roboto' from assets.
16:55:38:856
16:55:38:856 Java.Lang.RuntimeException: Font asset not found Roboto
16:55:38:856 at Java.Interop.JniEnvironment.StaticMethods.CallStaticObjectMethod(JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net8.0/JniEnvironment.g.cs:line 21453
16:55:38:856 at Java.Interop.JniPeerMembers.JniStaticMethods.InvokeObjectMethod(String encodedMember, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:line 165
16:55:38:856 at Android.Graphics.Typeface.CreateFromAsset(AssetManager mgr, String path) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net9.0/android-35/mcw/Android.Graphics.Typeface.cs:line 637
16:55:38:856 at Microsoft.Maui.FontManager.LoadTypefaceFromAsset(String fontfamily, Boolean warning) in /_/src/Core/src/Fonts/FontManager.Android.cs:line 133
16:55:38:856 --- End of managed Java.Lang.RuntimeException stack trace ---
16:55:38:856 java.lang.RuntimeException: Font asset not found Roboto
16:55:38:856 at android.graphics.Typeface.createFromAsset(Typeface.java:1054)
16:55:38:856 at mono.java.lang.RunnableImplementor.n_run(Native Method)
16:55:38:856 at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
16:55:38:856 at android.os.Handler.handleCallback(Handler.java:938)
16:55:38:856 at android.os.Handler.dispatchMessage(Handler.java:99)
16:55:38:856 at android.os.Looper.loop(Looper.java:236)
16:55:38:856 at android.app.ActivityThread.main(ActivityThread.java:8057)
16:55:38:856 at java.lang.reflect.Method.invoke(Native Method)
16:55:38:856 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
16:55:38:856 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
16:55:38:856
16:55:38:856 --- End of managed Java.Lang.RuntimeException stack trace ---
16:55:38:856 java.lang.RuntimeException: Font asset not found Roboto
16:55:38:856 at android.graphics.Typeface.createFromAsset(Typeface.java:1054)
16:55:38:856 at mono.java.lang.RunnableImplementor.n_run(Native Method)
16:55:38:856 at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
16:55:38:856 at android.os.Handler.handleCallback(Handler.java:938)
16:55:38:856 at android.os.Handler.dispatchMessage(Handler.java:99)
16:55:38:856 at android.os.Looper.loop(Looper.java:236)
16:55:38:856 at android.app.ActivityThread.main(ActivityThread.java:8057)
16:55:38:856 at java.lang.reflect.Method.invoke(Native Method)
16:55:38:856 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
16:55:38:856 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
I don't have font family Roboto configured.
If the PDF is rendered successfully, the exception is not thrown.
Hi Mateus,
Thank you for reaching out.
We attempted to reproduce the issue by loading the PDF in the PDF Viewer. However, we are unable to reproduce the issue where the "PDF is not loading in the PDF Viewer". Please find the attached sample we used to replicate the issue on our end. Could you please check the sample and let us know whether we have missed out on anything while replicating the issue?
To help us investigate further and provide a more accurate solution, we would appreciate it if you could share the following details:
We look forward to your response.
Regards,
Bharathi S
Hi Bharathi,
Thanks for the answer
I've added a sample project I created to simulate my project's reality as much as possible, including version and platform.
I tested only on Android (11, 12, and 15).
I also created a page with a password-related issue. In this specific case, entering the correct password triggers the component's Fail event, the password is not requested again and the pdf is not rendered. If the wrong password is entered, validation is successful.
This component will be used to render external documents, where retrieval is network-dependent.
I left a download function in case and a page where the rendering is successful, using the same download method.
Just in case. After click in the button at the corrupted page sample, look up into console for font exception
If you need more information, I am at your disposal.
Regards,
Attachment: MauiSyncFusionSample_4dc20b11.rar
Hi Mateus,
Thank you for the update. We were able to replicate the reported behaviors, where the password-protected PDF fails to open, and the warning message “Unable to load font 'Roboto' from assets” appears when attempting to load the corrupted PDF. We are currently in the process of validating the issue and will update you with further details by October 1, 2025.
Regards,
Bharathi S
Hi Mateus,
|
Query |
Response |
|
“Unable to load font 'Roboto' from assets” appears on output window when attempting to load the corrupted PDF |
We
confirm that the issue "Exception in Output window due to unregistered
Roboto font in PDF Viewer" is a defect. We will include the fix for the
issue in our weekly release on October 21, 2025. Kindly refer to the following feedback link to track the status of this update: Exception in Output window due to unregistered Roboto font in PDF Viewer
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.” |
|
Password-protected PDF fails to open |
Upon further analysis, we found that the issue where password-protected PDFs fail to open has been resolved internally. The fix is available in our latest version 31.1.22.
Please use the below link to download our latest weekly NuGet:https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer/31.1.22
Please let us know if you need any further assistance. |
Regards,
Bharathi S
Hi Bharathi, thanks for the replies. The password protection issue was resolved with version 31.2.22, and I'm waiting for the Roboto font fix.
I'm facing another issue that sometimes happens and sometimes doesn't.
So it's the same component, so I'm posting it in this already created forum.
The context is the same as before, but the application suddenly terminates, without exception, in debug and release when I try to render a specific PDF.
Searching the PDF, I didn't find anything that could be a problem other than external hyperlinks.
In Sentry, it's tracked as a NullReferenceException.
I tried to reproduce this in the same example I sent previously, and doesn't crash.
Due to it, I don't know if is something at my implementation that is causing this.
I also tried remove everything else rendered together but still crashs.
I can provide more details if needs.
Regards,
Mateus V. Miotto
Hi Mateus,
Thank you for the update.
|
Query |
Response |
|
“Unable to load font 'Roboto' from assets” appears on output window when attempting to load the corrupted PDF |
We have resolved the issue “Exception in Output window due to unregistered Roboto font in PDF Viewer” and now the fix for the issue is available in our latest weekly NuGet 31.2.3. Please find our latest Weekly NuGet: https://www.nuget.org/packages/Syncfusion.Maui.PdfViewer/31.2.3
Root cause details: The issue happened because a font used in the app wasn’t registered properly, which raised an exception in the Output window when certain popup or dialogs were loaded especially while handling corrupted PDFs. We resolved this by replacing the unregistered font with one that’s already registered and supported across all platforms, ensuring the app runs smoothly.
Exception in Output window due to unregistered Roboto font in PDF Viewer |
|
Application closes without exception in debug and release mode when rendering specific PDF |
Thank you for your query. We understand that the application closes without any exception in both debug and release modes when rendering a specific PDF. To help us investigate the issue further, could you please provide the following details?
Once we have this information, we’ll be able to proceed with an investigation. |
Regards,
Bharathi S
Hi Bharathi,
Thank you for the response.
I tested it on both physical iOS and the emulator, and it didn't crash. So it's specifically for Android.
Fisical devices:
Samsumg A54 using android 15 and 16 8Gb RAM - In 5x opening, 5 crashes
Samsumg S23 Android 16 8Gb RAM - In 5x opening, 5 crashes
Samsumg A03 Android 13 4Gb RAM - In 5x opening, 5 crashes
Xiaomi Redmi Note 8 Pro 6Gb Ram and Android 11 - In 5x opening, 3 crashes
Xiaomi Note 13 6Gb Ram and Android 15 - In 5x opening, 5 crashes
Motorola - Moto g8 plus Android 10 4Gb Ram - In 5x opening, 5 crashes
Emulator devices:
Pixel 5 pro 2Gb RAM Android 11 - In 5x opening, 5 craches
Pixel 7 pro 2Gb RAM Android 11 - In 5x opening, 5 craches
So, in release mode crash occur consistently.
At Emulators, in debug mode didn't crash, only noticed in release
When the issue occurred, I noticed that the success and failure events were not hit at the breakpoint and when the PDF was rendered, the rendering was fast.
Console output when crashed in release
14:14:20:368 [sentry-native] entering signal handler
14:14:20:368
14:14:20:427 [sentry-native] captured backtrace from ucontext with 10 frames
14:14:20:427
14:14:20:427 [sentry-native] captured backtrace with 10 frames
14:14:20:427
14:14:20:427 [sentry-native] merging global scope into event
14:14:20:427
14:14:20:427 [sentry-native] trying to read modules from /proc/self/maps
14:14:20:427
14:14:20:967 [sentry-native] read 451 modules from /proc/self/maps
14:14:20:967
14:14:21:019 [sentry-native] sending envelope
14:14:21:019
14:14:21:019 [sentry-native] crash has been captured
14:14:21:019
14:14:21:019 [libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1f in tid 28530 (.NET TP Worker), pid 26488 (om.company)
Xaml:
<!-- PDF -->
<syncfusion:SfPdfViewer
x:Name="PdfViewer"
x:DataType="vm:PublicacaoDetailsViewModel"
Background="Transparent"
BackgroundColor="Transparent"
DocumentLoadFailed="PdfViewer_DocumentLoadFailed"
DocumentLoaded="PdfViewer_DocumentLoaded"
DocumentSource="{Binding PdfDocumentStream}"
IsVisible="{Binding IsPdf}"
MaxZoomFactor="2"
MinimumHeightRequest="340"
PageLayoutMode="Continuous"
PasswordRequested="PdfViewer_PasswordRequested"
ShowScrollHead="False"
ShowToolbars="False"
ZoomFactor="1"
ZoomMode="FitToPage">
<syncfusion:SfPdfViewer.Triggers>
<!-- Hide viewer if LoadFails-->
<DataTrigger
Binding="{Binding PdfLoadFailed}"
TargetType="syncfusion:SfPdfViewer"
Value="True">
<Setter Property="IsVisible" Value="False" />
</DataTrigger>
<!-- Hide if is too big -->
<DataTrigger
Binding="{Binding IsPdfSizeTooBig}"
TargetType="syncfusion:SfPdfViewer"
Value="True">
<Setter Property="IsVisible" Value="False" />
</DataTrigger>
</syncfusion:SfPdfViewer.Triggers>
</syncfusion:SfPdfViewer>
I simplied as possible the ViewModel
public partial class PublicacaoDetailsViewModel : MauiViewModel, IDisposable
{
private readonly SemaphoreSlim _previewSemaphore = new(1, 1);
[ObservableProperty]
Stream? pdfDocumentStream;
private async Task PrepareVisualizacao()
{
if (_disposed) return;
await _previewSemaphore.WaitAsync();
HttpResponseMessage response;
try
{
response = await SharedHttpClient.GetAsync(link, HttpCompletionOption.ResponseHeadersRead, GetCancellationToken());
}
catch (OperationCanceledException)
{
return; // canceled / page closed
}
catch (Exception exHttp)
{
InternalExceptionHelper.LogException(exHttp, "Falha no GET do preview", "PrepareVisualizacao.Http");
if (IsPdf) PdfLoadFailed = true;
return;
}
using (response)
{
if (!response.IsSuccessStatusCode)
{
if (IsPdf) PdfLoadFailed = true;
return;
}
var maxSize = GetCurrentMaxPreviewSizeBytes();
if (response.Content.Headers.ContentLength is long contentLength &&
contentLength > 0 &&
contentLength > maxSize &&
!ForcarVisualizacaoArquivo)
{
IsPdfSizeTooBig = true;
CanShowFile = false;
return;
}
if (IsPdf)
{
try
{
var sourceStream = await response.Content.ReadAsStreamAsync();
var ms = new MemoryStream();
await sourceStream.CopyToAsync(ms, GetCancellationToken());
ms.Position = 0;
await MainThread.InvokeOnMainThreadAsync(() =>
{
DisposePdfStream();
PdfDocumentStream = ms;
});
}
catch (Exception exPdf)
{
InternalExceptionHelper.LogException(exPdf, "Falha ao montar PDF", "PrepareVisualizacao.Pdf");
PdfLoadFailed = true;
}
return;
}
}
}
finally
{
if (!alrearyLoaded) IsLoadingFile = false;
_previewSemaphore.Release();
}
private void DisposePdfStream()
{
try
{
PdfDocumentStream?.Dispose();
}
catch { }
finally
{
PdfDocumentStream = null;
}
}
public void Dispose()
{
if (_disposed) return;
_disposed = true;
Cleanup();
_previewSemaphore?.Dispose();
}
}
I've upload a .rar with 2 videos of my app running, one with error, and one with success.
And I didn't configure AOT for android publish.
Regards,
Att.
Attachment: PdfLoadFailVideo_8da04229.rar
Hi Mateus,
Thank you for the update.
We attempted to reproduce the issue by loading the PDF in Release mode on the Android emulator (Pixel 5, Android 11) and on Samsung devices running Android 15 and 16. However, we were unable to replicate the issue where the PDF Viewer crashes when loading the specific PDF in Release mode.
We have attached a sample project and a video demonstrating the steps we followed during our testing.
Please find the sample and video link below: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleAndVideo
Could you kindly review them and let us know if we missed anything in our replication process?
To help us investigate further, we would appreciate the following details:
Looking forward to your response.
Regards,
Bharathi S
Hi Bharathi,
After searching for what could be causing the aforementioned crash in my app, I reduced everything on the screen as much as possible, and it still persists.
Note that in the example sent previously, you are using version 31.2.3
So far, the latest available version for me is 31.2.4. However, after upgrading, cleaning, recompiling the project, and trying to run in Release mode, the app no longer launches, and the console output shows this:
10:27:22:527
[om.tecsmart.ap] * Assertion at /__w/1/s/src/mono/mono/mini/aot-runtime.c:3855, condition `is_ok (error)' not met, function:decode_patch, module 'Tecsmart.App.dll.so' is unusable (GUID of dependent assembly Syncfusion.Licensing doesn't match (expected 'CFE845DE-0C29-4B96-878A-CB719E81DF94', got '9EE8DA85-CAF8-482B-9ADA-B676B44DA018')).
10:27:22:527
[monodroid] * Assertion at /__w/1/s/src/mono/mono/mini/aot-runtime.c:3855, condition `is_ok (error)' not met, function:decode_patch, module 'Tecsmart.App.dll.so' is unusable (GUID of dependent assembly Syncfusion.Licensing doesn't match (expected 'CFE845DE-0C29-4B96-878A-CB719E81DF94', got '9EE8DA85-CAF8-482B-9ADA-B676B44DA018')).
Version 31.2.3 exhibits the same behavior.
Therefore, I can't test whether the error displayed in version 31.2.2 occurs in versions 31.2.3 or 31.2.4.
Has anything changed regarding the setup in these last two versions? Is there anything else that needs to be done?
Regards,
Hi Mateus,
Thank you for the update.
We tested the sample provided in our previous response using the latest version 31.2.4, and we were unable to reproduce the issue, "PDF Viewer crashes when loading the specific PDF." The application is launched and the PDF loaded successfully without any crash. For your reference, we’ve attached a sample and video showing the steps we followed.
There are no changes between versions 31.2.3 and 31.2.4 that would directly cause this issue. However, the error message you shared indicates a GUID mismatch between the AOT-compiled module (Tecsmart.App.dll.so) and the version of Syncfusion.Licensing.dll loaded at runtime. This typically occurs when the app is compiled with one version of the licensing assembly but runs with a different one.
To resolve this, please try the following steps:
Let us know if the issue persists after these steps.
Regards,
Bharathi S