firstfloorsoftware / flutter_sodium

Flutter bindings for libsodium
BSD 3-Clause "New" or "Revised" License
102 stars 47 forks source link

Cannot use libsodium #54

Closed maerlynflagg closed 3 years ago

maerlynflagg commented 3 years ago

i import the package and i do before any encryption call i do

Sodium.init();

but on some devices there came a exception:

dlopen failed: library "libsodium.so" not found

Screen of user:

![Screenshot_20210106-112014](https://user-images.githubusercontent.com/13437496/103878692-0fe83900-50d7-11eb-9a11-c17c521c636f.png)

is it a bug? or did i miss something?

do you have any idea, what the problem is?

kozw commented 3 years ago

Doesnt look good, couple of questions:

This is not necessarily related to specific devices, but could also be related to culture/language settings. If you can share as much info as possible, that would be great.

Thanks.

maerlynflagg commented 3 years ago

this issue hasn't every user. so i thought it's device specific. but currently i haven't details from the users device.

flutter_sodium version:

flutter_sodium: ^0.1.10

flutter doctor -v:

Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. Lernen Sie das neue plattformübergreifende PowerShell kennen – https://aka.ms/pscore6 PS C:\tfs\VisitCube-Lite> flutter doctor -v [√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19042.685], locale de-DE) • Flutter version 1.22.5 at C:\Users\...\flutter • Framework revision 7891006299 (4 weeks ago), 2020-12-10 11:54:40 -0800 • Engine revision ae90085a84 • Dart version 2.10.4 [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Users\...\AppData\Local\Android\Sdk • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = C:\Users\...\AppData\Local\Android\Sdk • ANDROID_SDK_ROOT = C:\Users\...\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [!] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [√] VS Code, 64-bit edition (version 1.52.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.18.1 [√] Connected device (1 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator) ! Doctor found issues in 1 category. PS C:\tfs\VisitCube-Lite>
maerlynflagg commented 3 years ago

I got some device infos:

kozw commented 3 years ago

There might be an issue with Android 6 and older versions, as described in https://github.com/flutter/flutter/issues/73318.

Looks like there is a possible workaround, that you'll need to apply in your Android's App java code. See https://github.com/flutter/flutter/issues/73318#issuecomment-754598119

maerlynflagg commented 3 years ago

okay, thanks. workaround looks simple.

vishnukvmd commented 3 years ago

@kozw I'm running into the same issue on a few devices that I unfortunately do not have access to.

https://github.com/flutter/flutter/issues/73318#issuecomment-754598119 suggests two work-arounds.

My settings.gradle already resembles the first work-around, so there's nothing to change there.

As for the second, it looks to me like it's supposed to be part of the plugin's Java code? https://github.com/firstfloorsoftware/flutter_sodium/pull/63 perhaps?

vishnukvmd commented 3 years ago

63 triggers https://github.com/flutter/flutter/issues/83613, so closing that.

@kozw @maerlynflagg Could you please tell me to where I'm supposed to add this workaround? Is there sample code I can draw inspiration from? Thank you!