Unable to run Android app after updating to cordova android 7.0.0

折月煮酒 提交于 2019-12-11 12:08:51

问题


I have created an Cordova Android 7 app while running app I get an error at

system.load("xxxx")

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader ......:couldn't find "xxxx.so"

in plugin.xml file I have defined jar and .so file like below :

<lib-file src="src/android/libs/xxxxx.jar"/>

<resource-file src="src/android/libs/armeabi/xxxx.so" target="libs/armeabi/xxxx.so" />

I hav tried all the possible ways by changing paths but no luck.What should be done to load library correctly ?

PS:The app works fine with cordova android version <7.

There is similar SO thread Add .so files to Cordova Plugin


回答1:


I am able to resolve this issue by renaming libs to jniLibs.

Change

<resource-file src="src/android/libs/armeabi/xxxx.so" target="libs/armeabi/xxxx.so"/>

to

<resource-file src="src/android/libs/armeabi/xxxx.so" target="jniLibs/armeabi/xxxx.so"/>



来源:https://stackoverflow.com/questions/48853992/unable-to-run-android-app-after-updating-to-cordova-android-7-0-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!