How to include a android native extension (.so) into an AIR native extension (.ane)?

南笙酒味 提交于 2019-12-11 17:56:22

问题


I'm currently trying to find a solution to have an AIR native extension including a C - library for Android that is using JNI.

So far, I tried to pack the .so lib into a jar, which then is packaged into the ane. As I learned here, I have to unpack the .so from the .jar first in order to access it.

The code found there seems to be working for a regular android project, unfortunatly when doing this for a .jar which is then packaged into an .ane, it seems to lose scope, resulting in a

FileNotFoundException: File path/to/my/lib was not found inside JAR

I already double and triple checked all paths and the contents of my jar. It's all there and spelled correctly.

Q1: How do I get access to the .so from actionscript?

Q2: Is there any other way to package/address the .so besides the regular extension-jar into the ane?

Q3: I really don't know much about the inner working of the .ane mechanism. Is it also possible to skip the .jar-wrapping and use the .so directly from actionscript?

As always, many thanks for any input.


回答1:


It becomes a bad habit of me to answer my own questions, but anyway...

Sometimes the docs can help. Here in the adobe docs I finally found the solution.

Simply copying the .so to the libs/armeabi-v7a folder in my ane package directory includes the lib into the ane, so I can use the .so from inside the java code of my extension.

Sorry for bothering.



来源:https://stackoverflow.com/questions/23217267/how-to-include-a-android-native-extension-so-into-an-air-native-extension-a

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