Update to Billing Library 3

seem like enablePendingPurchases should be always invoked at the first time.

I make a small fix, you can try the following jar.

PluginIAP.jar (36.1 KB)

Hi! I have tested locally and seemed to work fine :slight_smile:

I’m just updating on Play Store, if something goes wrong on live testing I will get in touch with you again

Thanks!!!
fryderyk

My OK was so quick @htlxyz :frowning:

Now that the IAP problem has gone, after testing on beta the game crashes again with something related to the sdkboxads module.

It seems something is wrong with some call, use of the api level 30, permissions and android 11 (my testing phone has android 11). A link to the problem here:

Anyway here is the stacktrace if it is of any help.

09-29 14:10:32.933 30421 30643 I UnityAds: com.unity3d.ads.configuration.InitializeThread$InitializeStateLoadCache.execute() (line:288) :: Unity Ads init: webapp loaded from local cache 09-29 14:10:33.530 1784 2089 D ConnectivityService: NetReassign [no changes] 09-29 14:10:33.542 30421 30479 E AndroidRuntime: FATAL EXCEPTION: ConnectivityThread 09-29 14:10:33.542 30421 30479 E AndroidRuntime: Process: com.generagames.ninjadash.samuraironin.jumprpg, PID: 30421 09-29 14:10:33.542 30421 30479 E AndroidRuntime: java.lang.SecurityException: getDataNetworkTypeForSubscriber 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.Parcel.createExceptionOrNull(Parcel.java:2373) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:2357) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:2340) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:2282) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8768) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3031) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:2995) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at com.unity3d.ads.connectivity.ConnectivityMonitor.connectionStatusChanged(ConnectivityMonitor.java:162) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at com.unity3d.ads.connectivity.ConnectivityNetworkCallback.onCapabilitiesChanged(ConnectivityNetworkCallback.java:48) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.net.ConnectivityManager$NetworkCallback.onAvailable(ConnectivityManager.java:3327) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.net.ConnectivityManager$CallbackHandler.handleMessage(ConnectivityManager.java:3607) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223) 09-29 14:10:33.542 30421 30479 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67) 09-29 14:10:33.543 30421 30556 I UnityAds: com.unity3d.ads.api.Sdk.logInfo() (line:70) :: Requesting configuration from https://publisher-config.unityads.unity3d.com/games/1671586/configuration?deviceMake=Google&screenDensity=440&screenSize=268435810&idfi=bcdda35f-1dc7-4194-aab9-fe0aaa8936b6&advertisingTrackingId=081a5afd-841d-44d1-9aa9-9fa34a443b4b&limitAdTracking=false&connectionType=wifi&screenHeight=1036&screenWidth=2204&bundleId=com.generagames.ninjadash.samuraironin.jumprpg&encrypted=true&rooted=false&platform=android&sdkVersion=2201&osVersion=11&deviceModel=Pixel%204a&language=es_ES&test=false&first=false&c.ads=true&c.external=true&c.gameExp=true 09-29 14:10:33.553 1784 30652 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 09-29 14:10:33.555 1784 2333 W ActivityTaskManager: Force finishing activity com.generagames.ninjadash.samuraironin.jumprpg/org.cocos2dx.cpp.AppActivity

Hope this can be solved as soon as possible, we are getting some massive drop in downloads and we think it’s because we use api level 29 and billing v2 in the current version of the game and they are going to be deprecated, so the update is really needed.

Thanks again for all the help!
fryderyk

@htlxyz, any news on this?

sorry for the late, the error comes from unityads.

which version are you using?

unity 3.4.8 has fixed this issue.

and now sdkbox using unityads 3.7.1.

OMG! Didn’t know about that, sorry for the incovenience. One last thing, is not an issue about sdkbox itself, but after upgrading to androidx, I’m facing the next issue:

  1. If I let the google-play-services.jar (the one provided with sdkbox) compile with the project I get tons of duplicate class errors.

  2. If I remove the jar and make the gps project to use my version of google play services (putting the version code on the gps manifest) the game compiles and runs fine, ads and purchases run fine too, but cloud services don’t work with ClassNotFoundException

    10-12 12:48:44.073 11151 11184 W System.err: java.lang.ClassNotFoundException: com.sdkbox.plugin.SdkboxGPGAuthentication
    10-12 12:48:44.073 11151 11184 W System.err: at java.lang.Class.classForName(Native Method)
    10-12 12:48:44.073 11151 11184 W System.err: at java.lang.Class.forName(Class.java:454)
    10-12 12:48:44.073 11151 11184 W System.err: at java.lang.Class.forName(Class.java:379)
    10-12 12:48:44.073 11151 11184 W System.err: at com.sdkbox.plugin.SDKBox.initPlugin(SDKBox.java:192)
    10-12 12:48:44.073 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
    10-12 12:48:44.074 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:129)
    10-12 12:48:44.074 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$10.run(Cocos2dxGLSurfaceView.java:328)
    10-12 12:48:44.074 11151 11184 W System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1502)
    10-12 12:48:44.074 11151 11184 W System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
    10-12 12:48:44.074 11151 11184 W System.err: Caused by: java.lang.ClassNotFoundException: com.sdkbox.plugin.SdkboxGPGAuthentication
    10-12 12:48:44.074 11151 11184 W System.err: … 9 more
    10-12 12:48:44.074 11151 11184 E SdkboxPlay: Can’t create Authentication java object.
    10-12 12:48:44.074 11151 11184 E SdkboxPlay: There’s no Java proxy object.
    10-12 12:48:44.075 11151 11184 I SDKBOX_CORE: Initialization request for plugin: ‘com/sdkbox/plugin/SdkboxGPGLeaderboards’
    10-12 12:48:44.077 11151 11184 W System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;
    10-12 12:48:44.077 11151 11184 W System.err: at java.lang.Class.classForName(Native Method)
    10-12 12:48:44.077 11151 11184 W System.err: at java.lang.Class.forName(Class.java:454)
    10-12 12:48:44.077 11151 11184 W System.err: at java.lang.Class.forName(Class.java:379)
    10-12 12:48:44.077 11151 11184 W System.err: at com.sdkbox.plugin.SDKBox.initPlugin(SDKBox.java:192)
    10-12 12:48:44.077 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
    10-12 12:48:44.077 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:129)
    10-12 12:48:44.077 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$10.run(Cocos2dxGLSurfaceView.java:328)
    10-12 12:48:44.077 11151 11184 W System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1502)
    10-12 12:48:44.077 11151 11184 W System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
    10-12 12:48:44.077 11151 11184 W System.err: Caused by: java.lang.ClassNotFoundException: com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
    10-12 12:48:44.077 11151 11184 W System.err: … 9 more
    10-12 12:48:44.080 11151 11184 I SDKBOX_CORE: Initialization request for plugin: ‘com/sdkbox/plugin/SdkboxGPGAchievements’
    10-12 12:48:44.081 11151 11184 W System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;
    10-12 12:48:44.081 11151 11184 W System.err: at java.lang.Class.classForName(Native Method)
    10-12 12:48:44.081 11151 11184 W System.err: at java.lang.Class.forName(Class.java:454)
    10-12 12:48:44.081 11151 11184 W System.err: at java.lang.Class.forName(Class.java:379)
    10-12 12:48:44.081 11151 11184 W System.err: at com.sdkbox.plugin.SDKBox.initPlugin(SDKBox.java:192)
    10-12 12:48:44.081 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
    10-12 12:48:44.081 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:129)
    10-12 12:48:44.081 11151 11184 W System.err: at org.cocos2dx.lib.Cocos2dxGLSurfaceView$10.run(Cocos2dxGLSurfaceView.java:328)
    10-12 12:48:44.081 11151 11184 W System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1502)
    10-12 12:48:44.081 11151 11184 W System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
    10-12 12:48:44.081 11151 11184 W System.err: Caused by: java.lang.ClassNotFoundException: com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
    10-12 12:48:44.081 11151 11184 W System.err: … 9 more

Any ideas on how to solve the conflict? Thx again for the support!

  • Use gradle to integrate google play service instead of jar files
  • ClassNotFoundException with com.sdkbox.plugin.SdkboxGPGAuthentication, use the latest google play service version.

take a look at this.