From ed0ca9664edde6e1791dbace5e8616a071846dba Mon Sep 17 00:00:00 2001 From: Wenhai Lin Date: Wed, 13 Apr 2016 19:52:23 +0800 Subject: [PATCH] bump external version to 'v3-deps-3' --- .../Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp | 2 +- native/cocos/platform/android/jni/JniHelper.cpp | 15 ++++++++------- native/external/config.json | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/native/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp b/native/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp index 5d6a306405..4982bb85af 100644 --- a/native/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp +++ b/native/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp @@ -47,7 +47,7 @@ extern "C" { JNIEXPORT jstring JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeGetContentText() { JNIEnv * env = 0; - if (JniHelper::getJavaVM()->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK || ! env) { + if (JniHelper::getJavaVM()->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK || ! env) { return 0; } std::string pszText = cocos2d::IMEDispatcher::sharedDispatcher()->getContentText(); diff --git a/native/cocos/platform/android/jni/JniHelper.cpp b/native/cocos/platform/android/jni/JniHelper.cpp index cfb65ba2e4..5497b9aed8 100644 --- a/native/cocos/platform/android/jni/JniHelper.cpp +++ b/native/cocos/platform/android/jni/JniHelper.cpp @@ -86,7 +86,7 @@ namespace cocos2d { JNIEnv* JniHelper::cacheEnv(JavaVM* jvm) { JNIEnv* _env = nullptr; // get jni environment - jint ret = jvm->GetEnv((void**)&_env, JNI_VERSION_1_4); + jint ret = jvm->GetEnv((void**)&_env, JNI_VERSION_1_6); switch (ret) { case JNI_OK : @@ -97,11 +97,12 @@ namespace cocos2d { case JNI_EDETACHED : // Thread not attached if (jvm->AttachCurrentThread(&_env, nullptr) < 0) - { - LOGE("Failed to get the environment using AttachCurrentThread()"); - - return nullptr; - } else { + { + LOGE("Failed to get the environment using AttachCurrentThread()"); + return nullptr; + } + else + { // Success : Attached and obtained JNIEnv! pthread_setspecific(g_key, _env); return _env; @@ -109,7 +110,7 @@ namespace cocos2d { case JNI_EVERSION : // Cannot recover from this error - LOGE("JNI interface version 1.4 not supported"); + LOGE("JNI interface version 1.6 not supported"); default : LOGE("Failed to get the environment using GetEnv()"); return nullptr; diff --git a/native/external/config.json b/native/external/config.json index 1a2599a1c3..5772ad5665 100644 --- a/native/external/config.json +++ b/native/external/config.json @@ -1,5 +1,5 @@ { - "version":"v3-deps-2", + "version":"v3-deps-3", "zip_file_size":"51659510", "repo_name":"cocos2d-x-lite-external", "repo_parent":"https://github.com/WenhaiLin/"