Mervill / Unity3D-NLua

Everything you need to get started using Lua in Unity3D. Indie & Pro compatible.
Boost Software License 1.0
190 stars 50 forks source link

"unable to find lua52" android unity build #21

Open Bmak opened 7 years ago

Bmak commented 7 years ago

Hello!

On Android devices, Lua can't start.

06-16 14:08:52.176: E/Unity(28731): Unable to find lua52 06-16 14:08:52.237: I/Unity(28731): DllNotFoundException: lua52 06-16 14:08:52.237: I/Unity(28731): at (wrapper managed-to-native) KeraLua.NativeMethods:LuaLNewState () 06-16 14:08:52.237: I/Unity(28731): at KeraLua.Lua.LuaLNewState () [0x00000] in :0 06-16 14:08:52.237: I/Unity(28731): at NLua.LuaLib.LuaLNewState () [0x00000] in :0 06-16 14:08:52.237: I/Unity(28731): at NLua.Lua..ctor () [0x00000] in :0 06-16 14:08:52.237: I/Unity(28731): at LogicController.InitNLua () [0x00000] in :0 06-16 14:08:52.237: I/Unity(28731): at LogicController.Awake () [0x00000] in :0

I assume that because I don't have android lua52 library -> lua52.so. Or lua52.a for iOs. If anyone has this libs could you share it with me or could you explain to me how to make this libs using lua sources? I'm using Unity for Windows with VS 2015.

xzfn commented 7 years ago

Install NDK and download NLua/Lua from Github. Type 'ndk-build' in android_build folder. You will get a 'libs' folder. There are x86/lua52.so, armeabi/lua52.so, armeabi-v7a/lua52.so in it. Copy this 'libs' folder to 'Assets/Plugins/Android/', like 'Assets/Plugins/Android/libs/x86/lua52.so. x86 version will probably be used in PC Android emulator, and armeabi-v7a in actual hardware phone. Click each binary and set proper import settings in Inspector. Then you get proper packages whether you build Windows version or Android version.

The 'official' lua downloaded from lua.org won't work, because NLua/Lua add some other things in lua sources. I tried and logcat said luanet_registeryindex not found. Be sure to check out logcat when something goes wrong.

Oozal commented 1 year ago

Was the issue fixed @Bmak ?

Oozal commented 1 year ago

Cause "DllNotFoundException: lua52" is still showing on android and ios build