在开发者M preVIEW共享库 [英] Shared Libraries in Developer M Preview
问题描述
我想测试一下我的版本的Android M开发preVIEW应用。
I am trying to test out my application on the Android M dev preview.
我的应用程序使用共享库,我已经放在JNI /库/ armeabi的Android Studio中。我相信,当它调用的System.loadLibrary(MYLIB)
这是扔以下的UnsatisfiedLinkError。是其他任何人有这个问题? Android的5.x的没有问题与此有关。
My application is using a Shared library, which I have placed in jni/libs/armeabi inside of Android Studio. I believe when it calls System.loadLibrary("myLib")
it is throwing the following UnsatisfiedLinkError. Is anyone else having this issue? Android 5.x has no problem with this.
06-02 08:24:28.004 16505-16505/com.me.workflow E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.me.workflow, PID: 16505
java.lang.UnsatisfiedLinkError: dlopen failed: library "{Path}/Android/Workflow/mobile/src/main//obj/local/armeabi/myLib.so" not found
at java.lang.Runtime.loadLibrary(Runtime.java:368)
at java.lang.System.loadLibrary(System.java:1076)
at com.me.workflow.service.WorkflowService.<clinit>(WorkflowService.java:108)
at com.me.workflow.activities.BaseServiceActivity.startWorkflowService(BaseServiceActivity.java:501)
at com.me.workflow.activities.WelcomeActivity.deployAndroidSetup(WelcomeActivity.java:639)
at com.me.workflow.activities.WelcomeActivity.onFileOperationCompleted(WelcomeActivity.java:842)
at com.me.workflow.tasks.CopyFromAssets.onPostExecute(CopyFromAssets.java:76)
at com.me.workflow.tasks.CopyFromAssets.onPostExecute(CopyFromAssets.java:42)
at android.os.AsyncTask.finish(AsyncTask.java:649)
at android.os.AsyncTask.-wrap1(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:666)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5401)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:725)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:615)
更新:
我收到关于这个问题的一些意见。在我的Android.mk文件我该线下方,目前的信念是,这条道路是不正确的,它是没有找到,因为它的文件。
I have received some feedback on the issue. In my Android.mk file I have the line below, currently the belief is that this path is not correct and that it is not finding the file because of it.
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/myLib.so
https://开头code.google.com / p / Android的开发技术preVIEW /问题/细节?ID = 2239
推荐答案
我解决我的问题,以确保库我的prebuild过的soname集。请参阅以下的Android开发者preVIEW问题线程
I solved my problem, by making sure my prebuild of the library had a soname set. See the following Android Developer Preview issue thread
https://开头code.google.com / p / Android的开发技术preVIEW /问题/细节?ID = 2239
项的10号左右我的prebuilt需要有SONAME集,我previously早已不是线程会谈。
item number 10 in the thread talks about my prebuilt needing to have the soname set, which I previously had not.
所以在我的库构建脚本我加了轮候册,-soname,LIB {} mylibname。所以我LDFLAGS变量
so in my library build script I added -Wl,-soname,lib{mylibname}.so to my LDFLAGS variable
export LDFLAGS="--sysroot ${TOOL_PREFIX}/sysroot -L${PREFIX}/lib -L${TOOL_PREFIX}/lib ${LDFLAGS_EXTRA} -Wl,-soname,libmylib1.0.so"
这篇关于在开发者M preVIEW共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!