无法在 Vungle android 上找到 isCacheAvailable 的方法 ID,因为它无法读取 Vungle 库
Failed to find method id of isCacheAvailable on Vungle android because it cannot read Vungle library
我正在使用 Sdkbox Vungle v1.2.0.1 和 Cocos2d-x v3.2。我在 iOS 上成功集成了 Vungle 和 运行。我使用方法 sdkbox::PluginVungle::isCacheAvailable()
来检查 Vungle 视频是否可用。但它不能在 android 上 运行。日志显示 INF: Failed to find method id of isCacheAvailable
。我认为发生此问题是因为它无法读取 Android 上的 Vungle SDK 库。
我已经根据 Vungle 集成文档完成了所有操作,我的 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)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/extensions)
$(call import-add-path,$(LOCAL_PATH))
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
LOCAL_SRC_FILES := cpp/main.cpp \
cpp/ProjectUtilsAndroid.cpp
LOCAL_SRC_FILES += $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../cocos2d/extensions \
$(LOCAL_PATH)/../../cocos2d/external/rapidjson \
$(LOCAL_PATH)/../../cocos2d/cocos/editor-support/spine \
$(LOCAL_PATH)/../../cocos2d/cocos/ui \
$(LOCAL_PATH)/../../cocos2d/cocos/network \
LOCAL_CFLAGS += -Wno-psabi -D CLASSIC
LOCAL_CPPFLAGS += -std=c++11
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_ui_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
LOCAL_STATIC_LIBRARIES += android_native_app_glue
LOCAL_LDLIBS += -landroid
LOCAL_LDLIBS += -llog
LOCAL_STATIC_LIBRARIES += PluginVungle
LOCAL_STATIC_LIBRARIES += sdkbox
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cocos/ui)
$(call import-module,cocos/network)
$(call import-module,extensions)
$(call import-module,editor-support/cocosbuilder)
$(call import-module,editor-support/spine)
$(call import-module,sdkbox)
$(call import-module,pluginvungle)
$(call import-module,.)
你能帮我弄清楚我到底漏掉了哪一部分吗?
EDIT:
onVungleCacheAvailable()
被触发,但每当我调用 sdkbox::PluginVungle::isCacheAvailable()
时,它总是 return false。
是sdkbox的bug,1.2.5版本修复了。
您可以下载1.2.5版本here
我正在使用 Sdkbox Vungle v1.2.0.1 和 Cocos2d-x v3.2。我在 iOS 上成功集成了 Vungle 和 运行。我使用方法 sdkbox::PluginVungle::isCacheAvailable()
来检查 Vungle 视频是否可用。但它不能在 android 上 运行。日志显示 INF: Failed to find method id of isCacheAvailable
。我认为发生此问题是因为它无法读取 Android 上的 Vungle SDK 库。
我已经根据 Vungle 集成文档完成了所有操作,我的 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)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/extensions)
$(call import-add-path,$(LOCAL_PATH))
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
LOCAL_SRC_FILES := cpp/main.cpp \
cpp/ProjectUtilsAndroid.cpp
LOCAL_SRC_FILES += $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../cocos2d/extensions \
$(LOCAL_PATH)/../../cocos2d/external/rapidjson \
$(LOCAL_PATH)/../../cocos2d/cocos/editor-support/spine \
$(LOCAL_PATH)/../../cocos2d/cocos/ui \
$(LOCAL_PATH)/../../cocos2d/cocos/network \
LOCAL_CFLAGS += -Wno-psabi -D CLASSIC
LOCAL_CPPFLAGS += -std=c++11
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_ui_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
LOCAL_STATIC_LIBRARIES += android_native_app_glue
LOCAL_LDLIBS += -landroid
LOCAL_LDLIBS += -llog
LOCAL_STATIC_LIBRARIES += PluginVungle
LOCAL_STATIC_LIBRARIES += sdkbox
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cocos/ui)
$(call import-module,cocos/network)
$(call import-module,extensions)
$(call import-module,editor-support/cocosbuilder)
$(call import-module,editor-support/spine)
$(call import-module,sdkbox)
$(call import-module,pluginvungle)
$(call import-module,.)
你能帮我弄清楚我到底漏掉了哪一部分吗?
EDIT:
onVungleCacheAvailable()
被触发,但每当我调用 sdkbox::PluginVungle::isCacheAvailable()
时,它总是 return false。
是sdkbox的bug,1.2.5版本修复了。 您可以下载1.2.5版本here