Cocos2dx 2.1.3 Android on Win7 and Eclipse juno

Hi All,

So I am trying to setup the dev env. and I have some problems when I run the default HelloWorld project.
Everything compiles and builds I don’t have any errors.
I am targetting platform 2.2 480x800, using host GPU, but no errors there.

What I get when I run in emulator is a black empty screen. LogCat says: “App freeze timeout expired. Force clearing freeze: AppWindowToken… etc”
This is all default setup and it should work out of the box since I followed the setup on the Wiki.
What could be wrong here?

Also what I find weird is the generated jni/hellocpp/main.cpp I don’t see anywhere the HelloWorldScene. Is there a problem with the default project generation?

Thanks a lot for helping me out.

@
#include “AppDelegate.h”
#include “platform/android/jni/JniHelper.h”
#include <jni.h>
#include <android/log.h>

#include “cocos2d.h”

#define LOG_TAG “main”
#define LOGD (…) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,VA_ARGS)

using namespace cocos2d;

extern “C”
{

jint JNI_OnLoad(JavaVM vm, voidreserved)
{
JniHelper::setJavaVM(vm);

return JNI_VERSION_1_4;
}

void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h)
{
if (!CCDirector::sharedDirector()->getOpenGLView())
{
CCEGLView view = CCEGLView::sharedOpenGLView;
view->setFrameSize;
AppDelegate
pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run();
}
}

}
@

What could be wrong here?

You should execute build_native.sh from your android app folder any paste output here.

Also what I find weird is the generated jni/hellocpp/main.cpp I don't see anywhere the HelloWorldScene. Is there a problem with the default project generation?

Thanks a lot for helping me out.

@
#include "AppDelegate.h" 

AppDelegate.cpp is the key, you should understand every derived method in there.

Thanks Krunoslav for your response.

>AppDelegate.cpp is the key, you should understand every derived method in there.
OK I get that.

You should execute build_native.sh from your android app folder any paste output here.

If I understand you right, you ask me to paste the output of the script. So here it is. I execute it in cygwin in the proj.android folder.
So I just re-built it, does it provide enough info for you or should I delete everything and re-do the whole thing? But as I said I didn’t have errors when compiling.

@
Gergely@ElOFitt-PC /cygdrive/d/_libraries/cocos2dx/cocosworld/proj.android
$ ./build_native.sh
NDK_ROOT = /cygdrive/d/_libraries/androidndk
COCOS2DX_ROOT = /cygdrive/d/_libraries/cocos2dx/cocosworld/proj.android/…/…
APP_ROOT = /cygdrive/d/_libraries/cocos2dx/cocosworld/proj.android/…
APP_ANDROID_ROOT = /cygdrive/d/_libraries/cocos2dx/cocosworld/proj.android
Using prebuilt externals
make: Entering directory `/cygdrive/d/_libraries/cocos2dx/cocosworld/proj.android’
Install : libgame.so => libs/armeabi/libgame.so
make: Leaving directory `/cygdrive/d/_libraries/cocos2dx/cocosworld/proj.android’
@

Sorry man, I didn’t see you’re talking about emulator - I’ve never managed to run a cococ2d-x app on it.

Try to run proj.win32 app for testing purpose until you may connect an Android device.

No problem and thanks for your input anyways.

Yes, luckily proj.win32 in VS2010 works out of the box as expected, so I’ll do as per your recommendations. Hope the emulator thing will fixed one day :slight_smile:

Thanks
Greg