-
Notifications
You must be signed in to change notification settings - Fork 92
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
2.0.0 To 2.1.0, realm_core.dart Function _createConfig changed #1647
Comments
➤ PM Bot commented: Jira ticket: RDART-1014 |
To me this seems like a compiler issue. I'm not sure how we can provoke that. Have you tried doing |
I tried doing flutter clean, But it didn't solve my problem。 |
2.1.0 code 2.0.0 code I changed the code from 2.1.0 to 2.0.0 and solved my problem. the problem : Attempt to execute code removed by Dart AOT compiler (TFA) |
I read your report. But the new code is just fine. The compiler should not remove it during tree-shaking. To my knowledge you are the only one with this problem. What version of flutter are you using? |
3.13.9 |
I don't think dart will execute switch code when it compiles, you should use triadic arithmetic, my English is terrible,sorry |
like a==1 ? (b==1 ? 1: 0) : 0 |
Switch expressions was added in Dart 3. Flutter 3.13.9 uses Dart 3.1.5. |
All our tests pass with flutter 3.19.3 / dart 3.1.5 and realm 2.1.0 - on my machine. Could you try creating a new project, add the realm package, and see if the issue exists with the new project? |
I have tested that in release mode, both Android and iOS will have the same issue
| |
***@***.***
|
|
***@***.***
|
…---- Replied Message ----
| From | Kasper Overgård ***@***.***> |
| Date | 04/24/2024 20:49 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [realm/realm-dart] 2.0.0 To 2.1.0, realm_core.dart Function _createConfig changed (Issue #1647) |
What does dart --version output?
Also, could you try option 2 from: dart-lang/sdk#53696 (comment)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Could you create a simple project that reproduces the issue and share it? As Kasper said, we do have tests that don't exhibit the problem, so having something we can test on will help us get to the bottom of it. |
@PaniniA This is indeed a bug in the Dart compiler (See dart-lang/sdk#52596). You need to upgrade to at least Dart 3.2.0 which was released together with Flutter 3.16.0. |
What happened?
Attempt to execute code removed by Dart AOT compiler (TFA)
Repro steps
await Realm.open(config). then Attempt to execute code removed by Dart AOT compiler (TFA)
Version
2.1.0
What Atlas Services are you using?
Local Database only
What type of application is this?
Flutter Application
Client OS and version
iOS 17.2
Code snippets
2.1.0 code
// final schemaVersion = switch (config) {
// (LocalConfiguration lc) => lc.schemaVersion,
// (FlexibleSyncConfiguration fsc) => fsc.schemaVersion,
// _ => 0,
// };
// _realmLib.realm_config_set_schema_version(configHandle._pointer, schemaVersion);
2.0.0 code
_realmLib.realm_config_set_schema_version(configHandle._pointer, config is LocalConfiguration ? config.schemaVersion : 0);
Stacktrace of the exception/crash you're getting
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: