最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - .so library is not found but is present in APK - Stack Overflow

programmeradmin5浏览0评论

I am writing an app with flutter. The app will run on a device under PayDroid 10 (arm NOT 64). To ease the dev, I've created a fluter package (apply plugin: 'com.android.library' in build.gradle) I have a .so library called libDeviceConfig.so and a jar file given by the manufacturer (let's name it manufacturer.jar). I can communicate with the physical device using the jar files. For example, I can get the serial number of the device without any issue. So the jar file access is ok. This getSerialNumber function doesn't need any library.

To communicate with the printer, I have to add the library libDeviceConfig.so. So, I add this libDeviceConfig.so in my app directory android/app/src/main/jniLibs/armeabi-v7a All seems ok. When I analyse the apk file, the libDeviceConfig.so is where I think it had to be !

But when I want to send a basic command to the printer (just feed and cut), I have an error :

E/flutter ( 5099): [ERROR:flutter/runtime/dart_vm_initializer(40)]
Unhandled Exception: PlatformException(error,
dalvik.system.DexClassLoader[DexPathList[[dex file
"/data/user/0/fr.XXX.yyy/files/nepcore.dex"],nativeLibraryDirectories=[/data/app/fr.XXX.yyy-0N9wsg2xGS6nFhXt5gFqYA==/lib/arm,
/data/resource/lib, /system/lib, /product/lib]]] couldn't find
"libDeviceConfig.so", null, null) E/flutter ( 5099): #0     
StandardMethodCodec.decodeEnvelope
(package:flutter/src/services/message_codecs.dart:652:7) E/flutter (
5099): #1      MethodChannel._invokeMethod
(package:flutter/src/services/platform_channel.dart:370:18) E/flutter
( 5099): <asynchronous suspension> E/flutter ( 5099): #2     
yyy.testPrinter (package:yyy/yyy.dart:34:12) E/flutter ( 5099):
<asynchronous suspension>

I don't understand where is the error. It seems that the lib is searched into /data/app/fr.xxx.yyy-7TanH8LD5gaN-5CG8bSjnA==/lib/arm and not found.

But I've seen some lines in logcat which seems to point the right directory :

vulkan - searching for layers in '/data/app/fr.xxx.yyy-7TanH8LD5gaN-5CG8bSjnA==/lib/arm'

vulkan - searching for layers in '/data/app/fr.xxx.yyy-7TanH8LD5gaN-5CG8bSjnA==/base.apk!/lib/armeabi-v7a'

I spent 2 days trying to solve this issue, but nothing helps. Do you have any idea ?

发布评论

评论列表(0)

  1. 暂无评论