black screen creating cocos2dx android project on mac

Hi, I was following the tutorial using a mac from [[http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter_1*-*How_to_Create_a_New_cocos2d-x_project_on_multi-platforms]] everything was good until I try to run the project on a AVD but only got a black screen, so I though may be it was the simulator so I try it on my samsung SIII but also got only a black screen.

  1. could any one help me with this problem?
  2. also every time I import the code to eclipse I get the Android 2.3.3 on the project, no matter what version I choose on the build_native.sh
    thanks in advance

So no one could help me? I think I am the only getting this problem, probably I forgot a step on the tutorial.
Also try the new version of cocos2dx and still get the same problem.

Juan Morete wrote:

So no one could help me? I think I am the only getting this problem, probably I forgot a step on the tutorial.
Also try the new version of cocos2dx and still get the same problem.

I am also seeing same issue on actual physical device with Android 4.1 as well as AVD (as AVD doesn’t support gles2, I enabled that from options). I tried creating 3 different projects, using both dynamic as well as static libraries but no luck. The debugging is so painful, I tried that as well but it don’t work properly.
Can anyone please help?

Thanks in advance!

try adding some sound files and check if they play.
moreover try to comment all sprite addition on your first scene just draw one sprite by making sure that its appearing in your resource folder.

Thanks Fahad.

I tried playing sound, but it doesn’t play it. I tried extracting .apk file, it shows the mp3 and png files I am using.

This is my first try to android, so please suggest me if my setup needs any tweaks :slight_smile:

My env is like this-

=
…/Classes/Android.mk
<pre>
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_logic_static

LOCAL_MODULE_FILENAME := libgame_logic

LOCAL_SRC_FILES := AppDelegate.cpp \

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/…/… \

LOCAL_STATIC_LIBRARIES := png_static_prebuilt
LOCAL_STATIC_LIBRARIES += xml2_static_prebuilt
LOCAL_STATIC_LIBRARIES += jpeg_static_prebuilt
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static

include $(BUILD_STATIC_LIBRARY)

$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libpng)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libxml2)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libjpeg)
</pre>

…/jni/Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /Android.mk, \
           cocos2dx \
           CocosDenshion/android \
              \
           ))

subdirs += $(LOCAL_PATH)/../../Classes/Android.mk $(LOCAL_PATH)/hellocpp/Android.mk

include $(subdirs)

…/jni/hellocpp/Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

LOCAL_SRC_FILES := main.cpp \
                   ../../../Classes/HelloWorldScene.cpp \

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
                        $(LOCAL_PATH)/../../../../ \
                        $(LOCAL_PATH)/../../../../CocosDenshion/android \
                        $(LOCAL_PATH)/../../../../CocosDenshion/android/jni \
                        $(LOCAL_PATH)/../../../../CocosDenshion/include \

LOCAL_STATIC_LIBRARIES := png_static_prebuilt
LOCAL_STATIC_LIBRARIES += xml2_static_prebuilt
LOCAL_STATIC_LIBRARIES += jpeg_static_prebuilt
LOCAL_STATIC_LIBRARIES += curl_static_prebuilt
LOCAL_WHOLE_STATIC_LIBRARIES := game_logic_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libpng)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libxml2)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libjpeg)

…/jni/Application.mk:

APP_STL := gnustl_static
APP_CPPFLAGS += -frtti
APP_MODULES := cocos2dx_static cocosdenshion_static game_logic_static game_shared

===