onepub-dev / dart_posix

MIT License
12 stars 4 forks source link

Fails on Android OnePlus 5 #4

Closed vHanda closed 1 year ago

vHanda commented 2 years ago

Hi.

I was trying this library out as an alternative to os (unmaintained). On my - ONEPLUS A5000 (mobile) • 6bf122e6 • android-arm64 • Android 10 (API 29). I get the follow error -

Invalid argument(s): Failed to load dynamic library 'libc.so.6': dlopen failed: library "libc.so.6" not found

I tried changing libc.so.6 to libc.so as the latter is what the os package uses, and that works for me (and about ~6k Android users). With that, the loading works but I then I get the following error -

Invalid argument(s): Failed to lookup symbol (undefined symbol: __errno_location)

I tried changing the relevant code to -

/// The error code set by various library functions.
int errno() => _errno.value;

/// Clear the errno by setting it to 0.
/// You should do this before calling a function that
/// may set errno.
void clearErrno() => _errno.value = 0;

final _errno = Libc().dylib.lookup<ffi.Int32>('errno');

But it also fails to find errno. Do you have any tips on how I can fix this?

bsutton commented 2 years ago

Have a look at this.

https://android.googlesource.com/kernel/lk/+/dima/for-travis/include/errno.h

On Thu, 6 Jan 2022, 1:25 am Vishesh Handa, @.***> wrote:

Hi.

I was trying this library out as an alternative to os https://github.com/dart-interop/os (unmaintained). One my - ONEPLUS A5000 (mobile) • 6bf122e6 • android-arm64 • Android 10 (API 29). I get the follow error -

Invalid argument(s): Failed to load dynamic library 'libc.so.6': dlopen failed: library "libc.so.6" not found

I tried changing libc.so.6 to libc.so as the latter is what the os package uses, and that works for me (and about ~6k Android users). With that, the loading words but I then I get the following error -

Invalid argument(s): Failed to lookup symbol (undefined symbol: __errno_location)

I tried changing the relevant code to -

/// The error code set by various library functions. int errno() => _errno.value;

/// Clear the errno by setting it to 0. /// You should do this before calling a function that /// may set errno. void clearErrno() => _errno.value = 0;

final _errno = Libc().dylib.lookup('errno');

But it also fails to find errno. Do you have any tips on how I can fix this?

— Reply to this email directly, view it on GitHub https://github.com/noojee/dart_posix/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OG4QC7PCJM2KH2DE6LUURIE3ANCNFSM5LKBB4OA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

bsutton commented 1 year ago

closing due to no response.

If someone wants to supply a PR to fix this it would be accepted.