真机调试遇到的问题,Luajavabridge相关,求助

大家好,今天在用lua和java交互的时候遇到一个问题,为了定位写了个demo也同样有问题,log如下,是不是在使用luaj的时候有什么地方没有设置?

11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.right = 640.00
11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.top = 1137.78
11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.bottom = 0.00
11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.c_left = -320.00
11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.c_right = 320.00
11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.c_top = 568.89
11-27 14:28:59.352: D/cocos2d-x debug info(21847): # display.c_bottom = -568.89
11-27 14:28:59.352: D/cocos2d-x debug info(21847): #
11-27 14:28:59.352: D/Device Model(21847): SimpleAudioEngine() - deviceModel = MI 4W
11-27 14:28:59.352: D/cocos2d-x debug info(21847): BaseFactory
11-27 14:28:59.352: D/cocos2d-x debug info(21847): printTickCount tickcount:1 thisptr:1906488840 msCCDBManager:0, sizeof(128) 84, 20
11-27 14:29:03.762: D/cocos2d-x debug info(21847): luaj.callStaticMethod(“com/benny/game/Luajavabridgedemo”,
11-27 14:29:03.762: D/cocos2d-x debug info(21847): “addTowNumber”,
11-27 14:29:03.762: D/cocos2d-x debug info(21847): args,
11-27 14:29:03.762: D/cocos2d-x debug info(21847): “(II)I”
11-27 14:29:03.762: D/luajc(21847): CCLuaJavaBridge::callJavaStaticMethod(lua_State *L)
11-27 14:29:03.762: A/libc(21847): Fatal signal 11 (SIGSEGV) at 0x0000002c (code=1), thread 21879 (Thread-3174)

需要看一下相关代码

-----------------------------------------------java 端-----------------------------------------------

package com.benny.game.luajavabridgedemo;

import org.cocos2dx.lib.Cocos2dxActivity;
import android.os.Bundle;

public class Luajavabridgedemo extends Cocos2dxActivity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
}

static {
    System.loadLibrary("game");
}

static public int addTowNumber(final int number1,final int number2)
{
    return number1+number2;
}

}

--------------------------lua------------------------

function MainScene:ctor()
local __item = ui.newTTFLabelMenuItem({
text = “this is luajavabridge test”,
size = 32,
x = display.cx,
y = display.cy,
align = ui.TEXT_ALIGN_CENTER,
listener = function()

        if device.platform ~= "android" then
            print("please run this on android device")
            return
        end

        self:luajTest()
    end
})
self:addChild(ui.newMenu({__item}))

end

function MainScene:luajTest()
local __javaClassName = “com/benny/game/Luajavabridgedemo”
local __javaMethodName = “addTowNumber”
local __javaParams = {1,2}

-- local __javaMethodSig = "(II)I"
luaj.callStaticMethod(__javaClassName, __javaMethodName, __javaParams)

end

刚刚试了下官网提供的luajavabridge 黑屏,没有什么提示信息。chukong_ad 没有什么问题,

local __javaClassName = “com/benny/game/luajavabridgedemo/Luajavabridgedemo”
你这个写错了 写掉一个目录

谢谢了,一语点醒梦中人!:10:

看来已经解决了,呵呵