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

Error version 3.3.0 #1759

Closed
AhmadFikriAS opened this issue Jul 24, 2024 · 12 comments
Closed

Error version 3.3.0 #1759

AhmadFikriAS opened this issue Jul 24, 2024 · 12 comments

Comments

@AhmadFikriAS
Copy link

What happened?

when i change version from 2.3.0 to 3.3.0 i got error

Repro steps

image

Version

3.4.0

What Atlas Services are you using?

Local Database only

What type of application is this?

Flutter Application

Client OS and version

Windows 11

Code snippets

No response

Stacktrace of the exception/crash you're getting

Exception has occurred.
RealmException (RealmException: Cannot get app directory. Error: Realm error : Realm SDK package version does not match the native library version (3.3.0 != 2.3.0). This is likely a bug in the Realm SDK - please file an issue at https://github.com/realm/realm-dart/issues)

Relevant log output

No response

Copy link

sync-by-unito bot commented Jul 24, 2024

➤ PM Bot commented:

Jira ticket: RDART-1078

@nirinchev
Copy link
Member

Looks like the native library hasn't been replaced correctly - can you try to rebuild your app?

@AhmadFikriAS
Copy link
Author

Looks like the native library hasn't been replaced correctly - can you try to rebuild your app?

Yes, I've done a rebuild of my app

@AhmadFikriAS
Copy link
Author

Looks like the native library hasn't been replaced correctly - can you try to rebuild your app?

Yes, I've done a rebuild of my app

its still same error

@nirinchev
Copy link
Member

Does this happen in a brand new project? Also, can you try to remove the realm packages from %LOCALAPPDATA%\Pub\Cache and redownload them?

@AhmadFikriAS
Copy link
Author

I didn't create a new project, and I also deleted the realm from pub/cache and re-downloaded it, but the error is still the same.

@blagoev
Copy link
Contributor

blagoev commented Jul 25, 2024

Can you also try a flutter clean inside your project root directory?

@AhmadFikriAS
Copy link
Author

Can you also try a flutter clean inside your project root directory?

I've done that, but still the same error.

image

@blagoev
Copy link
Contributor

blagoev commented Jul 25, 2024

I think it is highly likely that you have realm_dart.dll in your project directory. Can you search for realm_dart.dll in your project directory. If it is there delete it.
If there is no realm_dart.dll in your project directory, can you search for realm_dart.dll in your drive?

The error you are getting means that realm_dart.dll version 2.3.0 is loaded in your application instead of the 3.3.0 version. You should find the realm_dart.dll and remove it so 3.3.0 is loaded instead.

There is a way to check which dll and from where is loaded in your application but it is more involved, so for now could you do what I have suggested. If it does not help I will write you what you need to do to find exactly where is this dll loaded from.

@blagoev
Copy link
Contributor

blagoev commented Jul 25, 2024

If you run the app and let it fail you can open an elevated command prompt and run this power shell command. So

  1. Run command prompt as administrator
  2. type powershell
  3. type this command while your app is running and is still opened and your VS code is showing the error

Get-Process | where {$_.Modules -match 'realm_dart.dll'} | select -ExpandProperty modules | group -Property FileName | select name | where {$_ -match 'realm_dart.dll'}

this will give you the exact path from which realm_dart.dll is loaded.

I suspect it is the root dir of your project, but maybe somewhere else.

@AhmadFikriAS
Copy link
Author

If you run the app and let it fail you can open an elevated command prompt and run this power shell command. So

  1. Run command prompt as administrator
  2. type powershell
  3. type this command while your app is running and is still opened and your VS code is showing the error

Get-Process | where {$_.Modules -match 'realm_dart.dll'} | select -ExpandProperty modules | group -Property FileName | select name | where {$_ -match 'realm_dart.dll'}

this will give you the exact path from which realm_dart.dll is loaded.

I suspect it is the root dir of your project, but maybe somewhere else.

I think this method is very helpful, I just type in powershell and restart the application, and the error is fixed.

Thanks for your help. I really appreciate it

@blagoev
Copy link
Contributor

blagoev commented Jul 25, 2024

Glad it helped. After one successful run you should not need to this every time you start the app. This is needed only one time untill you have your app running with 3.3.0.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 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