cocos2d-x version: 3.3 (C++)
build platform: Ubuntu Linux 14.04
build target: Android (API level 15) (NDK r10d)
I created a new game wth cocos new and then built an APK with cocos run. It mostly works but a few features fail.
When I looked at the logcat output I saw some lines like this:
E/JniHelper(98038010): Failed to find static method id of getCocos2dxWritablePath
E/JniHelper(98038010): Failed to find static method id of setAnimationInterval
E/JniHelper(98038010): Failed to find static method id of preloadEffect
E/JniHelper(98038010): Failed to find static method id of getCocos2dxPackageName
E/JniHelper(98038010): Failed to find static method id of getBoolForKey
E/JniHelper(98038010): Failed to find static method id of playEffect
E/JniHelper(98038010): Failed to find static method id of pauseAllEffects
(Some occur multiple times.) If these functions are failing then that would explain why some features such as sound are not working in my game but how did this happen. Some grepping shows that these messages are coming from JNIHelper but the only file I changed in the proj.android/jni directory was Android.mk which now looks like this.
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/GameScreen.cpp \
../../Classes/HelpScreen.cpp \
../../Classes/SplashScreen.cpp \
../../Classes/Util.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_STATIC_LIBRARIES := cocos2dx_static
LOCAL_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,.)
$(call import-module,audio/android)
$(call import-module,extensions)
Is something wrong there? Any help in solving this would be gratefully appreciated.