Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> cocos2dx轉Andriod常見問題

cocos2dx轉Andriod常見問題

編輯:關於Android編程

1 NDK_ROOT not defined. Please define NDK_ROOT in your environment or in local.properties 在路徑cocos2d-x-2.2.2/samples/Cpp/HelloCpp(功成名)/proj.android下的build_native.sh文件中的 APPNAME="HelloCpp"下添加:
NDK_ROOT="/Users/user/Documents/android-ndk-r9c"
2 導入Eclipse有三個報錯 將路徑cocos2d-x-2.2.2/cocos2dx/platform/android/java/src/org/cocos2dx/下的lib拷貝到 cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx下

3 The connection to adb is down, and a severe error has occurred.
(1) 重啟Eclipse (2 )如果重啟不行的話就cd到platform-tools下鍵入adb kill-server ,如果adb關閉了會提示 server not running *,再輸入adb start-server 如果不成功會提示 daemon not running. starting it now on port ***的而如果成功的話不提示任何語句的.這時再重新打開eclipse就可以正常運行模擬器的了.
4 unfortunately, hellocpp has stopped

I fixed the problem by add the following lines in Cocos2dxActivity.java:

// …add to FrameLayout

framelayout.addView(this.mGLSurfaceView);

// NOTICE: to comment it out when you release the application

this.mGLSurfaceView.setEGLConfigChooser(8 , 8, 8, 8, 16, 0);

The problem is because Android emulator can’t support OpenGL ES 2.0 well. But my “solution” is a only a temporary one when you run application in emulator. (The app is fine when I run the app in real device.)


  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved