我正在使用c++编写一个基础的android应用程序,使用cocos2d-x框架显示背景图片。
应用程序编译正常,.apk文件中包含了我使用的png文件。但是在Galaxy Note(Android 4.1)上启动时,它只显示黑屏。我还尝试添加背景音乐,以查看是否播放,但没有成功。
我还尝试使用动态库而不是静态库,但也没有成功。Android调试部分工作,所以我无法成功调试它。
请问有人可以帮忙看看我的设置有什么问题吗?对于冗长的帖子感到抱歉。
我的Android和Application mk文件如下-
===================================
../Classes/Android.mk
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)
===================================
../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
===================================
如果您对这些mk文件中的重复内容有任何清理建议,我将非常感激。