flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

Can't load dynamic libraries from other packages when using flutter_inappweb (on Android 5 and 6.)

Open jpolstre opened this issue 2 years ago • 1 comments

Environment

Technology Version
Flutter version 3.0.1
Plugin version 5.4.3+7
Android version 5 and 6

Device information:

Description

Spected behavior: Use flutter_inappwebview package on Android 5 and 6 devices in conjunction with other packages that load dynamic libraries (specifically Isar, flutter_js).

Current behavior: It is not possible to load the dynamic libraries of the other packages, when using the flutter_inappwebview package(on Android 5 and 6).

Steps to reproduce

  1. Add this to your pubspect.yaml in a new project:
 ...
 flutter_js: ^0.5.0+6
 isar: ^3.0.0-dev.0
 flutter_inappwebview: ^5.4.3+7
  1. Try on an emulator or physical device running Android 5 or 6. You will get an error like this:
Unable to load dynamic library  *.so

3.Now do the same but without the inappwebview flutter package:

 ...
 flutter_js: ^0.5.0+6
 isar: ^3.0.0-dev.0
  1. Everything will load correctly.

Note.- on devices with Android >= 7, it works correctly. The problem appears only on devices with Android 5 and 6 (SDK <=22)

Stacktrace/Logcat

with Isar and flutter_inappwebview:

Invalid argument(s): Failed to load dynamic library 'libisar.so': dlopen failed: library "libisar.so" not found
E/flutter ( 5871): #0      initializeCoreBinary
package:isar/…/native/isar_core.dart:62
E/flutter ( 5871): #1      openIsar
package:isar/…/native/open.dart:53
E/flutter ( 5871): #2      _IsarNative.open

with flutter_js and futter_inappwebview:

( 6264): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libfastdev_quickjs_runtime.so': dlopen failed: library "libfastdev_quickjs_runtime.so" not found
E/flutter ( 6264): #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
E/flutter ( 6264): #1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
E/flutter ( 6264): #2      _qjsLib
package:flutter_js/quickjs/ffi.dart:129
E/flutter ( 6264): #3      _qjsLib (package:flutter_js/quickjs/ffi.dart)
package:flutter_js/quickjs/ffi.dart:1
E/flutter ( 6264): #4      _jsNewRuntime
package:flutter_js/quickjs/ffi.dart:163
E/flutter ( 6264): #5      _jsNewRuntime (package:flutter_js/quickjs/ffi.dart)
package:flutter_js/quickjs/ffi.dart:1
E/flutter ( 6264): #6      jsNewRuntime
package:flutter_js/quickjs/ffi.dart:206
E/flutter ( 6264): #7      QuickJsRuntime2._ensureEngine
package:flutter_js/quickjs/quickjs_runtime2.dart:51

So the problem is from flutter inappwebview

jpolstre avatar May 25 '22 04:05 jpolstre

👋 @jpolstre

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

github-actions[bot] avatar May 25 '22 04:05 github-actions[bot]

Same here as descibed in couchbase issue

filipenanclarez avatar Oct 06 '22 17:10 filipenanclarez

Possible solutions:

https://github.com/simolus3/drift/issues/895#issuecomment-729165464

https://github.com/flutter/flutter/issues/59834#issuecomment-1223471763

filipenanclarez avatar Oct 06 '22 17:10 filipenanclarez