Cocos2D在游戏开发中的致命异常

时间:2015-05-15 18:00:33

标签: java android eclipse cocos2d-iphone import

我是Java的新手,我使用Cocos2D获得致命异常。 我的主要活动:

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

    // landscape orientation
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    // view
    CCGLSurfaceView glSurfaceView = new CCGLSurfaceView(this);
    setContentView(glSurfaceView);
    CCDirector.sharedDirector().attachInView(glSurfaceView);

    // sensor manager
    configSensormanager();

    // configure CCDirector 
    CCDirector.sharedDirector().setScreenSize(320, 480);

    // Starts title screen
    CCScene scene = new TitleScreen().scene();
    CCDirector.sharedDirector().runWithScene(scene);


}

private void configSensormanager() {
    SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    DeviceSettings.setSensorManager(sensorManager);
}

ERROR

05-15 17:42:12.260: E/AndroidRuntime(3001): FATAL EXCEPTION: main
05-15 17:42:12.260: E/AndroidRuntime(3001): Process: br.com.spaceandtime, PID: 3001
05-15 17:42:12.260: E/AndroidRuntime(3001): java.lang.NoClassDefFoundError: Failed resolution of: Lorg/cocos2d/nodes/CCDirector;
05-15 17:42:12.260: E/AndroidRuntime(3001): at br.com.spaceandtime.MainActivity.onCreate(MainActivity.java:34)

我已经尝试过更改cocos2d lib,但它不起作用 而且我来自巴西所以...对不起我的英语不好

0 个答案:

没有答案