SDKBox 2.4.3.0 bugfix

2.4.3.0 (20181214)

Add

  1. IAP: getPurchaseHistory api for Android, onPurchaseHistory(const std::string& purchasesJson) for result.

Upgrade

Bugfix

  1. Core: fix Android crash bug, unsatisfiedlinkerror-on-released-game, issue2, issue3

  2. Review: android.view.WindowManager$BadTokenException crash

  3. JSB2: JSListenerBase::invokeJSFun crash

  4. SDKBoxPlay:

  5. Facebook: logpurcase crash on Android

  6. IAP: recover restore a subscription on Android

  7. IAP: fixed java.util.concurrentmodificationexception

  8. IAP Unreal: compile error with unreal 4.20 with commit

Thanks,

3 Likes

Hi there!
I have updated the iap plugin in order to use the new getPurchaseHistory method and now my app is crashing on startup on all my android 5 devices. JFYI, I downgraded iap plugin to 2.4.2.0 and it works fine on that devices. Can you confirm this is a bug?

Thanks!
fryderyk

I’ll check this issue ASAP.

I can not reproduce this crash issue with android os 4.x, 5.x version.
could you plz show your crash logcat here ?
Thanks,

@yinjimmy UnsatisfiedLinkError in SDKBOX core is still happening on Android 8.0.0 on my Moto G6 with SDKBOX 2.4.3. My config:
NDK 16b
Cocos2DX 3.17.1

Steps to reproduce:

  1. create new cocos game
  2. import sdkbox facebook (or any other sdkbox plugin - i have tried with iap also)
  3. BUILD > OK
  4. RUN Error:

No implementation found for void com.sdkbox.plugin.SDKBox.nativeInit(java.lang.Object, java.lang.ClassLoader) (tried Java_com_sdkbox_plugin_SDKBox_nativeInit and Java_com_sdkbox_plugin_SDKBox_nativeInit__Ljava_lang_Object_2Ljava_lang_ClassLoader_2)

12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime java.lang.UnsatisfiedLinkError: No implementation found for void com.sdkbox.plugin.SDKBox.nativeInit(java.lang.Object, java.lang.ClassLoader) (tried Java_com_sdkbox_plugin_SDKBox_nativeInit and Java_com_sdkbox_plugin_SDKBox_nativeInit__Ljava_lang_Object_2Ljava_lang_ClassLoader_2)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at com.sdkbox.plugin.SDKBox.nativeInit(Native Method)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at com.sdkbox.plugin.SDKBox.init(SDKBox.java:71)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at com.sdkbox.plugin.SDKBoxActivity.onCreate(SDKBoxActivity.java:12)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at org.cocos2dx.cpp.AppActivity.onCreate(AppActivity.java:35)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.Activity.performCreate(Activity.java:6984)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1235)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2783)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2909)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.ActivityThread.-wrap11(Unknown Source:0)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1606)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:105)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.os.Looper.loop(Looper.java:164)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:6592)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at java.lang.reflect.Method.invoke(Native Method)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
12-31 11:09:45.361 com.net4uonline.testgame 14890 - E AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)

thx.

Akshay

cpp3171/proj.android/gradle.properties

plz PROP_BUILD_TYPE=cmake to PROP_BUILD_TYPE=ndk-build .

UPDATE:

sdkbox plugin

cpp3171/proj.android/app/jni/sdkbox/CMakeLists.txt:


cmake_minimum_required(VERSION 3.6)

set(lib_name sdkbox)
set(target_name ext_${lib_name})

project(${lib_name})

#include(../../../../cocos2d/external/cmake/CocosExternalConfig.cmake)

add_library(${target_name} STATIC IMPORTED GLOBAL)

set_target_properties(${target_name} PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/../"
)
if(ANDROID)
  if("${ANDROID_STL}" STREQUAL "c++_static")
      set(SDKBOX_LIBS_FOLDER libs_c++_static)
  else()
      set(SDKBOX_LIBS_FOLDER libs)
  endif()
  set_target_properties(${target_name} PROPERTIES
    IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/${SDKBOX_LIBS_FOLDER}/${ANDROID_ABI}/lib${lib_name}.a"
  )
endif()

pluginadmob plugin


cmake_minimum_required(VERSION 3.6)

set(lib_name pluginadmob)
set(target_name ext_${lib_name})

project(${lib_name})

#include(../../../../cocos2d/external/cmake/CocosExternalConfig.cmake)

add_library(${target_name} STATIC IMPORTED GLOBAL)

set_target_properties(${target_name} PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/../"
)
if(ANDROID)
  if("${ANDROID_STL}" STREQUAL "c++_static")
      set(SDKBOX_LIBS_FOLDER libs_c++_static)
  else()
      set(SDKBOX_LIBS_FOLDER libs)
  endif()
  set_target_properties(${target_name} PROPERTIES
    IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/${SDKBOX_LIBS_FOLDER}/${ANDROID_ABI}/lib${lib_name}.a"
  )
endif()

add to project

cpp3171/CMakeLists.txt

# add admob lib 
if(ANDROID)
    add_definitions(-DSDKBOX_ENABLED)
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/pluginadmob/)
    target_link_libraries(${APP_NAME} ext_pluginadmob
    )
endif()

# add sdkbox lib
if(ANDROID)
    add_definitions(-DSDKBOX_ENABLED)
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox/)
    target_link_libraries(${APP_NAME} ext_sdkbox
    )
endif()
3 Likes

Hi~
I still have ‘Drive.SCOPE_APPFOLDER’ problem in latest sdk version(2.4.3.0).
First signIn to gps is ok for saving game data to google cloud service.
But after few minutes, when I launch my game again and click ‘save to cloud’ button,
then ‘IllegalStateException: Must include Drive.SCOPE_APPFOLDER to use snapshots’ exception message is displayed.
My android os version is 6.0.
Please reply me if any solution~~~
Have a nice day.

sorry for late, we will check this.

I’m having the same issue on Android 6.0 too. Do we know if there is a fix yet @htlxyz ?

yes. but havn’t release. you can try sdkbox update --staging

It works! Thanks :slight_smile: