Skip to content
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

Expected type in realm core function #1541

Closed
ivanespitiac opened this issue Mar 6, 2024 · 4 comments
Closed

Expected type in realm core function #1541

ivanespitiac opened this issue Mar 6, 2024 · 4 comments

Comments

@ivanespitiac
Copy link

What happened?

When execute flutter build apk --debug the realm dependency generate this error:

../../../.pub-cache/hosted/pub.dev/realm_dart-1.9.0/lib/src/native/realm_core.dart:1793:30: Error: Expected type 'void Function(Pointer<Void>, int)' to be 'void Function(Object, int)', which is the Dart type corresponding to 'NativeFunction<Void Function(Handle, Int32)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
 - 'Object' is from 'dart:core'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Handle' is from 'dart:ffi'.
 - 'Int32' is from 'dart:ffi'.
    final callback = Pointer.fromFunction<Void Function(Handle, Int32)>(user_change_callback);
                             ^
Target kernel_snapshot failed: Exception

I'm working with:

  • Azure Devops pipeline macOS-12.7.3
  • Flutter 3.20.0-17.0.pre.101
  • Dart 3.4.0
  • Java 17
  • Gradle 7.6
  • Realm 1.9.0

Repro steps

Follow this commands on azure pipeline:

flutter clean
flutter pub get
dart run realm install
flutter build apk --debug

Version

1.9.0

What Atlas Services are you using?

Local Database only

What type of application is this?

Flutter Application

Client OS and version

Android 30.0.3

Code snippets

No response

Stacktrace of the exception/crash you're getting

Running Gradle task 'assembleDebug'...                          
Checking the license for package Android SDK Build-Tools 30.0.3 in /Users/runner/Library/Android/sdk/licenses
License for package Android SDK Build-Tools 30.0.3 accepted.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Installing Android SDK Build-Tools 30.0.3 in /Users/runner/Library/Android/sdk/build-tools/30.0.3
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
Checking the license for package Android SDK Platform 28 in /Users/runner/Library/Android/sdk/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /Users/runner/Library/Android/sdk/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
../../../.pub-cache/hosted/pub.dev/realm_dart-1.9.0/lib/src/native/realm_core.dart:1793:30: Error: Expected type 'void Function(Pointer<Void>, int)' to be 'void Function(Object, int)', which is the Dart type corresponding to 'NativeFunction<Void Function(Handle, Int32)>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Void' is from 'dart:ffi'.
 - 'Object' is from 'dart:core'.
 - 'NativeFunction' is from 'dart:ffi'.
 - 'Handle' is from 'dart:ffi'.
 - 'Int32' is from 'dart:ffi'.
    final callback = Pointer.fromFunction<Void Function(Handle, Int32)>(user_change_callback);
                             ^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/runner/work/1/s/flutter/bin/flutter'' finished with non-zero exit value 1

Relevant log output

No response

Copy link

sync-by-unito bot commented Mar 6, 2024

➤ PM Bot commented:

Jira ticket: RDART-959

@nielsenko
Copy link
Contributor

nielsenko commented Mar 6, 2024

This bug has already been addressed, but the fix is not released yet.

Could you downgrade your flutter version? Latest stable (3.19.2) should suffice.

@ivanespitiac
Copy link
Author

@nielsenko sure, i'll make the downgrade to try.

@nirinchev
Copy link
Member

Closing this as it's fixed already, just not released yet.

@nirinchev nirinchev closed this as not planned Won't fix, can't repro, duplicate, stale Mar 10, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants