-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Synchronization Not Working in Release Mode with Dotmim.Sync on MAUI App (AOT Compilation Error) #1268
Comments
By the way, this function causes the error.
|
@Mimetis I wanted to ask if the Dotmim framework supports MAUI on iOS. I have been using this framework for the past six months to build my application, and I am close to completion. However, I am encountering the same error that JustAnotherLars mentioned, and I haven't seen a response addressing this issue yet. I thought it would be best to reach out and inquire whether this issue has been resolved or if there are plans to resolve it before making any further plans for my app. Thank you! |
I have no idea, I never tried or used AOT compilation |
@JustAnotherLars @generic823 I asked Claude about the above error and it returned the following info - is this helpful? This error occurs because Dotmim.Sync is using dynamic code generation/reflection (specifically trying to JIT compile a dynamic method) which isn't supported in iOS AOT mode. To fix:
Choose option 1 for better performance, option 2 for simpler implementation. |
I tried both of Claude's suggestions and unfortunately neither of them fixed the error. @Mimetis do you have any more thoughts/suggestions? Alas at this point it appears I'm going to have to go find another sync solution to use. |
Can you share a sample (a really simple sample that highlight the failure), preferably a GitHub repository, I can use to reproduce the error ? |
I might be able to. @JustAnotherLars are you able to do that? @Mimetis just realize that you'll have to create an iOS Distribution certificate and Ad-hoc provisioning profile, and deploy it to an iOS device, in order to see the issue; are you in a position to be able to do that? I don't believe there's any way around that. |
No I don't have an iOS device, I'm running an Android phone, unfortunately. Can we reproduce the error, using the release mode, and the android emulator ? |
No, it's specifically an iOS issue. So a small sample won't do you any good. Not to be a negative nellie but it seems unlikely you'll be able to repro the error without an iOS device to deploy to. @JustAnotherLars or @generic823, do you have any other ideas? |
Here is detailed info on how someone got that other sync toolkit to work; @JustAnotherLars or @Mimetis, would this info help to resolve the issue here as well? |
Description:
I'm using Dotmim.Sync as a singleton service in a .NET MAUI app to handle data synchronization. The issue I’m experiencing is that synchronization works perfectly in Debug mode but fails in Release mode.
In Release mode, no synchronized objects are visible in the app, though the app itself doesn't crash. The following error message appears in the logs during synchronization attempts:
The error seems related to JIT compilation, which is restricted in AOT-only environments. I've tried enabling the Mono Interpreter for Release builds as a workaround:
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'"> <UseInterpreter>true</UseInterpreter> </PropertyGroup>
However, with this setting, the app fails to start entirely in Release mode.
Description:
I'm using Dotmim.Sync as a singleton service in a .NET MAUI app to handle data synchronization. The issue I’m experiencing is that synchronization works perfectly in Debug mode but fails in Release mode.
In Release mode, no synchronized objects are visible in the app, though the app itself doesn't crash. The following error message appears in the logs during synchronization attempts:
The error seems related to JIT compilation, which is restricted in AOT-only environments. I've tried enabling the Mono Interpreter for Release builds as a workaround:
However, with this setting, the app fails to start entirely in Release mode.
Steps to Reproduce:
Configure Dotmim.Sync as a singleton in a .NET MAUI app.
Run the synchronization in Debug mode - it works as expected.
Deploy the app in Release mode on an iOS device.
Observe the error in the log file.
Expected Behavior:
Synchronization should work in both Debug and Release modes without needing JIT compilation.
Actual Behavior:
In Debug mode, synchronization works as expected.
In Release mode, the synchronization fails due to the AOT restriction, and enabling the Mono Interpreter prevents the app from starting.
Version Information:
Dotmim.Sync.Core: 1.2.0
Dotmim.Sync.Sqlite: 1.2.0
Dotmim.Sync.Web.Client: 1.2.0
.NET MAUI: net8.0
Platform: iOS (Release mode)
Workarounds Attempted:
Enabled Mono Interpreter for Release builds (true), but the app fails to start.
Additional Context: Any advice on using Dotmim.Sync in AOT environments like iOS in Release mode, or if alternative configuration settings could resolve the AOT compilation issues, would be appreciated.
The text was updated successfully, but these errors were encountered: