Android 2.1/2.2 not supported?

Using cocos2d-1.0.1-x-0.10.0, android-ndk-r7, cygwin 1.7, eclipse indigo and Win7 SP1 Ultimate x64:

Compiled “HelloWorld/Android” using “build_native.sh” under cygwin: Succesfull
Added as existing project to eclipse and then executed. Results:
Under 2.1 virtual device = Black Screen
Under 2.2 virtual device = Black Screen
Under 4.0.3 virtual device = Works (15fps)

Compiled “Tests/Test.Android” using “build_native.sh” under cygwin: Succesfull
Added as existing project to eclipse and then executed. Results:
Under 2.1 virtual device = Black Screen
Under 2.2 virtual device = Black Screen
Under 4.0.3 virtual device = Works (15fps)

Generated a new project with create-android-project Succesfull
Compiled the “Default Project” using “build_native.sh” under cygwin: Succesfull
Under 2.1 virtual device = Black Screen
Under 2.2 virtual device = Black Screen
Under 4.0.3 virtual device = Works (15fps)

2.1/2.2 are supported.
From your description, I don’t know what causes the error.

Can it be i build the code using ndk r7? Should i use an older version?
I got some warnings but it could compile correctly… i dont know if anyone got the same problem as me but its a pain for me because i want to debug with android 2.1 devices :frowning:
I just followed all the tutorials in the wiki to install the ndk, cygwin, and compile the projects, everything seems to be fine but im surprised i get a black screen with those devices… next time im going to try with 3.0. =/

Edit: I get this message in the Logcat:
12-19 04:18:30.144: W/ActivityManager(58): Activity idle timeout for HistoryRecord{44e7ad00 org.cocos2dx.application/.ApplicationDemo}
12-19 04:18:30.134: W/ActivityManager(58): Launch timeout has expired, giving up wake lock!
12-19 04:18:30.604: W/ActivityManager(58): Activity pause timeout for HistoryRecord{44e7ad00 org.cocos2dx.application/.ApplicationDemo}
12-19 04:18:30.755: W/InputManagerService(58): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44e9e0f0

I don’t make anything special, i just compile the helloworld and run it inside eclipse! :frowning: What’s wrong?
Can you send me a compiled version of your helloworld for android so i can test it it’s a compilation problem? (then it can be the ndk version)

I now installed androd-ndk-r6b, my projects work now with android 2.1, no more black screens (still low frame rate 15fps, is that normal?)

Edited: I don’t know what happened again but im getting the black screen again! :frowning: This is frustrating… it worked the first time but now is not working anymore, i thought it was a problem with the ndk-r7 but no… it seems with ndk-r6b it works for the first time then it stopped working, i tried deleting the apk, cleaning the project, etc, it is not working anymore…
Sometimes it works, sometimes it doesnt, i have to uninstall the app frmo the device, clean project and then rerun, and “sometimes” it works… but almost always i get the black screen!
Also, it only worked with 2.2 version (im just trying to run the hello world…), with 2.1 i can never get it working.

Will this help?:
12-19 07:19:43.155: W/apk path(265): /data/app/org.cocos2dx.application-1.apk
12-19 07:19:43.374: D/libEGL(265): egl.cfg not found, using default config
12-19 07:19:43.374: D/libEGL(265): loaded /system/lib/egl/libGLES_android.so
12-19 07:19:43.474: D/dalvikvm(265): GC_EXTERNAL_ALLOC freed 1143 objects / 76184 bytes in 64ms
12-19 07:19:43.864: I/ARMAssembler(265): generated scanline000001B7:03515144_00009003_00000000 at in 3395370 ns
12-19 07:19:43.894: I/ARMAssembler: generated scanline
000001B7:03515144_00009001_00000000 [177 ipp] (273 ins) at [0x23db00:0x23df44] in 2741915 ns
12-19 07:19:49.974: W/apk path(265): /data/app/org.cocos2dx.application-1.apk
12-19 07:20:01.184: W/dalvikvm(265): JNI WARNING: expected return type ‘L’
12-19 07:20:01.214: W/dalvikvm(265): calling Lorg/cocos2dx/lib/Cocos2dxActivity;.terminateProcess ()V
12-19 07:20:01.214: W/dalvikvm(265): in Lorg/cocos2dx/lib/Cocos2dxRenderer;.nativeRender ()V (CallStaticObjectMethodV)

So i don’t think the ndk version is a problem here… can someone help me?

Try to do Project Clean

How can i clean the project properly? I tried “Project-Clean” frmo the eclipse menu but that didn’t work. I can send you the APK’s generated if you want.

Can you tell me how to manually clean the project?

May be you should refer [[Build project with ndk-r7]] and [[Some cautions of Android 4.0]].

Using cocos2d-1.0.1-x-0.10.0, android-ndk-r6b, cygwin 1.7, eclipse indigo, and WinXP SP2:

Under 2.1 virtual device = Black Screen
Under 2.2 virtual device = Black Screen
Under 4.0.3 virtual device = Works (10fps)

I have same problem.

Are the resources copied into assets, and the res folder has subfolders such as res/values, res/drawable-hdpi and so on.

Using cocos2d-1.0.1-x-0.10.0, android-ndk-r6b, eclipse indigo, and MacOSX 10.6.8:

Under 2.1 virtual device = Works (10fps)
Under 2.2 virtual device = Works (10fps)
Under 4.0.3 virtual device = Works (10fps)

WinXP not supported?

winxp/win7 are supported.

It seems windows is not supported at all, it works with mac… but not with windows?
Im using cygwin last version to compile everything, i switched to ndk-r6b like him but it is the same…
We have both the same problem ;(

I tried to clean the project, even to delete and rebuild it, also tried to redowload the cocos2dx and rebuild the helloworld, and i can’t make it work anymore… even tried to make the same project but with a different name.
All goes to black screen and im only using the hello world example! I dont know why the first time worked… there has to be something there… some file inside cocos2dx.

Here are the only warnings i get when building the project:
C:/cocos2d-1.0.1-x-0.10.0/HelloWorld/android/jni/…/…/…/cocos2dx/platform/CCImage.cpp: In member function ‘bool cocos2d::CCImage::_initWithPngData(void*, int)’:
C:/cocos2d-1.0.1-x-0.10.0/HelloWorld/android/jni/…/…/…/cocos2dx/platform/CCImage.cpp:267: warning: ‘png_info_struct::color_type’ is deprecated (declared at C:/cocos2d-1.0.1-x-0.10.0/HelloWorld/android/jni/…/…/…/cocos2dx/platform/third_party/android/libpng/png.h:650)
C:/cocos2d-1.0.1-x-0.10.0/HelloWorld/android/jni/…/…/…/cocos2dx/platform/CCImage.cpp:267: warning: ‘png_info_struct::color_type’ is deprecated (declared at C:/cocos2d-1.0.1-x-0.10.0/HelloWorld/android/jni/…/…/…/cocos2dx/platform/third_party/android/libpng/png.h:650)

Also… is 10/15fps normal?
Im getting 60fps with Mac OSX Lion and XCode4 emulator…

May be you should describe what you do step by step, from downloading the sourcecode to run the program.

About the fps, android emulator executes arm codes and XCode4 emulator executes native codes.

Steps are really easy:

1-Install latest android SDK (default folder, program files~~>android)
2-Install NDK in C: root
3-Install latest eclipse, java, and the adt plugin… in C: root
4-Install latest cocos2dx stable in C: root
5-Instal latest cygwin in C: root
6-Change build_native.sh inside cocos2dx~~>helloworld~~>android to point the correct paths
7-Open cygwin and put build_native.sh inside, press enter, and compiles correctly with only 3 warnings
8-Open eclipse, Add new project from existing folder cocos2dx~~>helloworld~~>android
9-Compile and run using an Android 2.1 emulator
10-Black Screen
11-Project~~>Clean, Compile and run using an Android 2.2 emulator
12-Black Screen
13-Project~~>Clean, Compile and run using Android 4.0 emulator
14-Works
Also tried recompiling the source deleting the “libs” and “objs” folder first everytime before compiling and cleaning, but it is the same. Also tried “build_native.sh clean” before a rebuilt but it’s the same…
Also tried changing the project name so the APK installed is with a different name, but still black screen.
Also tried generating a new emulator device and execute the APK inside the newly created device… Black Screen.
Me~~>Frustrated but… at least i have my mac! And i can code with XCode ( but cant publish to Android :frowning: )

I can send you the generated APK as i don’t have an android device to test it, only the emulator…
Is strange that… it worked the first time i installed all the stuff, but only on the 1st run…

When you new project at step 8, which android sdk version did you select?
Please paste the apk.
Thank you.

In step 8 i checked android 2.1 (x7) and the other things to default.

I found a way to “partially” run it! But well… its not very nice, the image is not centered :S
I have to delete the project from eclipse, and create the project again (same name, same parameters, it warns the proyect already exists but its ok) then it can compile again (only for the first time off course, the next times are black screen).

Here is the image where you can see the result of this “trick”.
Also, if i clean the project it doesn’t works at all, if i dont clean the project, then it shows the image i captured, strange… should i recompile build_native.sh too?

I can run the ApplicationDemo.apk you pasted on my g10.
It runs ok.

So what’s the problem with the emulator not running it under windows?