-
I have an Uno application that runs fine in debug, but when compiled with Profile Guided AoT, it reports a runtime error, likely related to trimmed APIs. Is there a technique that can be used to identify what API(s) are being trimmed and how to update LinkerConfig.xml appropriately? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
To troubleshoot which API is being called you can use the following log configuration: It may give you a hint into what area is causing the issue, but it's generally not linker related, but rather AOT compiler related at the boundary between interpreted and AOTed code. Once you find what it is, we may be able to hint the AOT compiler. |
Beta Was this translation helpful? Give feedback.
-
After working with @jeromelaban , we were able to determine the issue was related to a SkiaSharp API - specifically, a PNG codec was not available after AOT compilation, but was available in debug. Fortunately, I was able to implement a workaround. During the diagnostics, we enabled EMCC Profiling as detailed here: Profiling WebAssembly applications. // _loResImage.ImageData is a byte[] containing a PNG
// Failing code
var loResStream = new MemoryStream(_loResImage.ImageData);
// The Decode method had an internal error unable to run the PNG codec
var loResBitmap = SKBitmap.Decode(loResStream);
// Alternate code that runs without error
var loResSkImage = SKImage.FromEncodedData(_loResImage.ImageData);
var loResBitmap = SKBitmap.FromImage(_loResSkImage); |
Beta Was this translation helpful? Give feedback.
After working with @jeromelaban , we were able to determine the issue was related to a SkiaSharp API - specifically, a PNG codec was not available after AOT compilation, but was available in debug. Fortunately, I was able to implement a workaround.
During the diagnostics, we enabled EMCC Profiling as detailed here: Profiling WebAssembly applications.