I compiled cjson. so myself and put it in the app's private path. Use the following code to load the library
_lua.run('package.cpath = package.cpath .. ";/data/data/${Constants.appPkg}/app_so/?.so"')
Then load it in Lua
local f, err = package.loadlib(
"/data/data/top.coclyun.clipshare/app_so/cjson.so",
"luaopen_cjson"
)
print(f, err)
Outputs:
nil dynamic libraries not enabled; check your Lua installation
Can't load the library? Or is there an error in the SO file I compiled?