-
Notifications
You must be signed in to change notification settings - Fork 4
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
(Android) Sometimes the error - Failed to load dynamic library (dlopen failed: library "libsystemclock.so" not found) is coming #4
Comments
The issue of opening native so files often occurs in Android(Especially lower Android versions), so I am not very clear about the real cause of this problem. But after search. It seems that some other library which uses ffi contains the same issues according simolus3/drift#420 (comment) , it maybe useful. |
I have just pushed a commit 451c2c4 to dev branch. You can try this by use pub git package If this problem still exists, may I could do nothing to solve this problem completely. |
cool. I'll try this and update if I see this error again. |
Just saw your commit, I was under the impression that the .so file is loaded from the underlying OS, and not from the APK. So how does this help? |
in old android system, the Android can load .so files in apk directly. So when Android installs the application, it will export its native library to the lib directory. But I am not sure if this solution will solve your problem. |
Tried the dev branch, I'm getting a compile error :
|
Any updates on this? Adding |
Really! That is weird. Do you have any idea why that makes it work. Why did it occur to you to try that? Another observation I've had while using this package (I'm still using 0.7.0 and haven't tried this patch on dev branch): If you include a call to SystemClock right as the first line in main.dart, this issue does not seem to happen. Eg:
On my devices I have never seen this issue to happen again after doing this change. Previously I was calling it only in some widgets based on business logic. I am still calling it in those widgets, but after it has been called once in the beginning, it seems to work the rest of the times. |
"Missing import" is kind of an obvious fix. I tried to put a call to SystemClock as the first line of |
This is my mistake. I didn’t check it carefully when I submitted it.
Does the dev branch worked for you? If it works, I will release a new version. |
It works yeah |
aah ok. I got confused, I thought adding the import somehow makes the dynamic library issue disappear on v0.7.0 I'll also upgrade and check |
This happens when I try to call
SystemClock.elapsedRealtime()
on app start. It usually happens when I try to run the app in debug mode on an Android device after the device has been restarted. In subsequent runs it goes away. I haven't found a way to reliably replicate it, but it happens now and then. Probably usually after I get back to work the next morning, the first run throws up this error. Hot restarting the app does not fix it. Only upon stopping and running it again, it goes away.Would you have any idea of why this could happen?
I feel it is only happening on an older android device I have - running Android 6.0.1 (API 23)
Sorry about the sparse details, but that's all I could notice.
The text was updated successfully, but these errors were encountered: