Getting error after adding sdkbox plugin to android project

Hi,

I’m new to sdkbox so I’ve made a new project with cocos cmd utility. (cocos2d-x 3.8.1 c++)
Then I’ve checked that it builds and runs on iOS (Xcode) and Android (Android Studio).
Till now no suprises…

Then I’ve added sdkbox import iap to my project.
Projects builds fine both for iOS and Android.
It runs fine on iOS simulator…

But when I’m trying to run Android version on an emulator, I get the following error:

09-30 17:15:22.560    4287-4301/com.tinyhands.seasons A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4301 (Thread-168)
09-30 17:15:22.572    4287-4287/com.tinyhands.seasons D/Cocos2dxActivity﹕ onWindowFocusChanged() hasFocus=true

What’s get corrupted in a project after invoking sdkbox import iap or what am I doing wrong?


Regards, Mike.

check out these steps to see what happens with Cocos2dxActivity.java. A sample of what is needed is included here.

Also, we have a sample that you can look at as well: https://github.com/chukong/sdkbox-iap-sample

1 Like

Which emulator are you using for your cocos2d-x android project?

Genymotion and Android’s native.

Thanks, I’ve added the missing parts and it seems to work now, at least I didn’t get those nasty error messages.

Although there are still few error messages popup in the log:

10-01 12:10:38.734  14029-14029/com.xxx.yyy D/Cocos2dxActivity﹕ onWindowFocusChanged() hasFocus=true
10-01 12:10:38.734  14029-14043/com.xxx.yyy I/dalvikvm﹕ Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo, referenced from method com.sdkbox.plugin.TrackingInfo$1.run
10-01 12:10:38.734  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve static method 1758: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;.getAdvertisingIdInfo (Landroid/content/Context;)Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
10-01 12:10:38.734  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0004
10-01 12:10:38.746  14029-14050/com.xxx.yyy E/TrackingInfo﹕ reqAdvertisingIdentifier Error:java.lang.NoClassDefFoundError: com.google.android.gms.ads.identifier.AdvertisingIdClient
10-01 12:10:38.746  14029-14043/com.xxx.yyy D/PluginFactory﹕ Java class name of plugin PluginFlurryAnalytics is : com/sdkbox/plugin/PluginFlurryAnalytics
10-01 12:10:38.746  14029-14043/com.xxx.yyy I/SDKBox﹕ class name : ----com/sdkbox/plugin/PluginFlurryAnalytics----
10-01 12:10:38.746  14029-14043/com.xxx.yyy D/PluginFactory﹕ Tconfig: XY5QDJP45JNYSTFRT4BK
10-01 12:10:38.754  14029-14043/com.xxx.yyy E/dalvikvm﹕ Could not find class 'com.flurry.sdk.i', referenced from method com.flurry.sdk.lj.a
10-01 12:10:38.754  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve const-class 190 (Lcom/flurry/sdk/i;) in Lcom/flurry/sdk/lj;
10-01 12:10:38.754  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x1c at 0x001e
10-01 12:10:38.754  14029-14043/com.xxx.yyy I/dalvikvm﹕ Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method com.flurry.sdk.iq.m
10-01 12:10:38.754  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve static method 1759: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
10-01 12:10:38.754  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0009
10-01 12:10:38.754  14029-14043/com.xxx.yyy I/dalvikvm﹕ Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo, referenced from method com.flurry.sdk.iq.n
10-01 12:10:38.754  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve static method 1758: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;.getAdvertisingIdInfo (Landroid/content/Context;)Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
10-01 12:10:38.754  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0009
10-01 12:10:38.758  14029-14043/com.xxx.yyy I/dalvikvm﹕ Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient$Info.getId, referenced from method com.flurry.sdk.iq.d
10-01 12:10:38.758  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve virtual method 1756: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;.getId ()Ljava/lang/String;
10-01 12:10:38.758  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0008
10-01 12:10:38.758  14029-14043/com.xxx.yyy I/dalvikvm﹕ Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient$Info.isLimitAdTrackingEnabled, referenced from method com.flurry.sdk.iq.e
10-01 12:10:38.758  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve virtual method 1757: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;.isLimitAdTrackingEnabled ()Z
10-01 12:10:38.758  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0008
10-01 12:10:38.762  14029-14032/com.xxx.yyy D/dalvikvm﹕ GC_CONCURRENT freed 156K, 3% free 8792K/8976K, paused 2ms+0ms, total 4ms
10-01 12:10:38.762  14029-14043/com.xxx.yyy I/dalvikvm﹕ Could not find method android.os.StatFs.getAvailableBlocksLong, referenced from method com.flurry.sdk.im.a
10-01 12:10:38.762  14029-14043/com.xxx.yyy W/dalvikvm﹕ VFY: unable to resolve virtual method 246: Landroid/os/StatFs;.getAvailableBlocksLong ()J
10-01 12:10:38.762  14029-14043/com.xxx.yyy D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x003c
10-01 12:10:38.778  14029-14043/com.xxx.yyy I/SDKBox﹕ class name : ----com/sdkbox/plugin/SDKBoxIAPGooglePlay----
10-01 12:10:38.782  14029-14043/com.xxx.yyy D/CSC﹕ Refreshing products: 'com.cocos2dx.plugintest2,com.cocos2dx.plugintest3,com.cocos2dx.non2,com.cocos2dx.non1'
10-01 12:10:39.226  14029-14032/com.xxx.yyy D/dalvikvm﹕ GC_CONCURRENT freed 279K, 4% free 8923K/9236K, paused 0ms+0ms, total 2ms
10-01 12:10:39.366  14029-14043/com.xxx.yyy D/cocos2d-x debug info﹕ create rendererRecreatedListener for GLProgramState
10-01 12:10:39.366  14029-14043/com.xxx.yyy D/CocosPlayClient.cpp﹕ isEnabled = 0
10-01 12:10:39.366  14029-14043/com.xxx.yyy D/CocosPlayClient.cpp﹕ isDemo = 0
10-01 12:10:39.366  14029-14043/com.xxx.yyy D/CocosPlayClient.cpp﹕ isNotifyFileLoadedEnabled = 0
10-01 12:10:39.386  14029-14043/com.xxx.yyy D/cocos2d-x debug info﹕ create rendererRecreatedListener for GLProgramState
10-01 12:10:39.402  14029-14043/com.xxx.yyy D/cocos2d-x debug info﹕ create rendererRecreatedListener for GLProgramState
10-01 12:10:39.418  14029-14043/com.xxx.yyy D/cocos2d-x debug info﹕ create rendererRecreatedListener for GLProgramState
10-01 12:10:39.498  14029-14043/com.xxx.yyy D/CSC﹕ no native iap wrapper listener
10-01 12:10:39.742  14029-14032/com.xxx.yyy D/dalvikvm﹕ GC_CONCURRENT freed 339K, 4% free 8998K/9364K, paused 0ms+0ms, total 2ms
10-01 12:10:50.938  14029-14043/com.xxx.yyy I/Process﹕ Sending signal. PID: 14029 SIG: 9

Is it ok now?

I think you are missing something. Let us ask @nite to take a look at the log you provided.

Double check your google play service integration, looks like flurry can’t find it.

Can you please point more specifically where should I check for it? I’m using Android Studio, just in case.

Check your proj.android-studio/app/project.properties and see if there is an entry for google play service.