cocos2d-x并在android Studio中运行

时间:2017-02-09 12:53:42

标签: android-studio cocos2d-x

我将在android Studio中运行一个cocos项目但是当在cmd.exe中输入命令cocos compile -p android时说ndk中的错误。 和android.mk是:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

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

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes

# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END


LOCAL_STATIC_LIBRARIES := cocos2dx_static

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END

my cmd

1 个答案:

答案 0 :(得分:0)

就像现在我说你使用NDK 12或更高版本。 默认情况下,这些NDK添加arm64-v8a体系结构支持。您在libfreetype.a文件夹中没有cocos2d/external/freetype2/prebuilt/android/arm64-v8a/个文件,因为默认情况下cocos2d不会生成,这会降低编译速度。

解决方案是您可以使用NDK 11或更小的
否则使用最新版本的cocos2d-x并对所有拱门armeabi armeabi-v7a x86 arm64-v8a启用ABI支持,而不是armeabi

一些有关话题/问题

https://github.com/cocos2d/cocos2d-x/issues/15713
https://github.com/cocos2d/cocos2d-x/issues/15566