Can't load native shared library with dependencies in a native activity app

后端 未结 4 1933
心在旅途
心在旅途 2020-12-15 00:19

In my Android app I have 4 libraries:

libTemplate.so
   depends on libPorkholt.so
libPorkholt.so
   depends on libpng15.so
   depends on liblua.so
   depends         


        
4条回答
  •  佛祖请我去吃肉
    2020-12-15 01:11

    I don't think Android will automatically load libraries other than the ones specified in the manifest, so you should create a "dummy" Java class to load external dependencies, it should contain:

    static {
        System.loadLibrary("openal");
        System.loadLibrary("lua");
        System.loadLibrary("png15");
        System.loadLibrary("Porkholt");
        System.loadLibrary("Template");
    }
    

    Since this section is static, it will be executed when the class is loaded, even if its methods aren't called.

提交回复
热议问题