My Lua 스크립트는 LOOP으로 컴파일되고, 컴파일 된 스크립트 모듈은 데스크톱 컴퓨터 (OSX 10.7.5)에서 잘 실행됩니다. 하지만 Android 폰 (Android 2.3.6)에서 실행하면 항상 실패하고 attempt to call a string value
이라고 불평합니다. 동일한 스크립트가 동일한 전화에서 스크립트 (컴파일되지 않은) 방식으로 문제없이 실행될 수 있습니다.Lua 오류 : Android NDK에서 "문자열 값을 호출하려고합니까?"
루아 5.1.5 및 Android NDK r8b가 테스트에 사용됩니다.
로그 캣에서 오류 :
12-26 09:40:26.934: E/libb22luapre(8190): Failed to run script: attempt to call a string value
는 C 코드 (오류가 단순 제거 처리 코드) :
const char script[] = "require \"hello.world\"\n"
"require \"anothermodule\"\n"
"hello.world.test2()";
luaL_loadstring(L, script);
lua_pcall(L, 0, LUA_MULTRET, 0);
내가 미리로드 된 테이블을 덤프, 이러한 필수 모듈은 이미 (성공적으로로드 존재).
웹을 검색했지만 해결책을 찾을 수 없습니다. 모든 조언을 크게 주시면 감사하겠습니다.
[업데이트 됨] 나는 android 용 lua 명령을 컴파일하고 컴파일 된 lua 스크립트를 그 안에 임베드했다. 오류는 위와 동일합니다.
$ adb shell
$ cd /data/local
$ ls
tmp
lua
dump_preload.lua
$ ./lua dump_preload.lua
--- print table --- preload
test function: 0x376f0
anothermodule function: 0x37718
hello.world function: 0x376b0
--- print table --- loaded
string table: 0x33828
debug table: 0x37098
package table: 0x33d30
_G table: 0x32528
io table: 0x34e80
os table: 0x357b8
table table: 0x332c0
math table: 0x36530
coroutine table: 0x33988
--- print table --- loaders
1 function: 0x33ed8
2 function: 0x33ef8
3 function: 0x33f18
4 function: 0x33f38
$ ./lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> require 'test'
attempt to call a string value
stack traceback:
[C]: ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
> require 'hello.world'
attempt to call a string value
stack traceback:
[C]: ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
>