Crashing on startup with old Google Play Services

When the app is run on Android devices with older Google Play services, it crashes at the start.

Crash log:

09-13 10:39:24.626    5937-5957/? W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7895000 but found 7571038
09-13 10:39:24.626      736-736/? D/CustomFrequencyManagerService﹕ releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1958400  uid : 1000  pid : 736  tag : ACTIVITY_RESUME_BOOSTER@9
09-13 10:39:24.726    1083-1083/? D/STATUSBAR-NetworkController﹕ onSignalStrengthsChanged signalStrength=SignalStrength: 26 -1 -1 -1 -1 -1 -1 99 2147483647 2147483647 2147483647 -1 2147483647 gsm|lte 0x4 level=4
09-13 10:39:24.816      257-257/? E/SMD﹕ DCD OFF
09-13 10:39:24.846    5937-5957/? D/cocos2d-x debug info﹕ create rendererRecreatedListener for GLProgramState
09-13 10:39:24.846    5937-5957/? W/dalvikvm﹕ Invalid indirect reference 0x42aead40 in decodeIndirectRef
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ "GLThread 2488" prio=5 tid=13 RUNNABLE
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ | group="main" sCount=0 dsCount=0 obj=0x42aeb370 self=0x7980fa48
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ | sysTid=5957 nice=0 sched=0/0 cgrp=apps handle=2040647688
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ | state=R schedstat=( 251362450 15503908 86 ) utm=20 stm=5 core=1
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:74)
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1510)
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1249)
09-13 10:39:24.846    5937-5957/? I/dalvikvm﹕ [ 09-13 10:39:24.846  5937: 5957 E/dalvikvm ]
    VM aborting
09-13 10:39:24.846    5937-5957/? A/libc﹕ Fatal signal 6 (SIGABRT) at 0x00001731 (code=-6), thread 5957 (Thread-2488)
09-13 10:39:24.906     736-6286/? D/CustomFrequencyManagerService﹕ releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 2457600  uid : 10009  pid : 1206  tag : LAUNCHER_APP_BOOSTER_CPU@41
09-13 10:39:24.946      254-254/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-13 10:39:24.946      254-254/? I/DEBUG﹕ Build fingerprint: 'samsung/kltexx/klte:4.4.2/KOT49H/G900FXXU1ANE4:user/release-keys'
09-13 10:39:24.946      254-254/? I/DEBUG﹕ Revision: '14'
09-13 10:39:24.946      254-254/? I/DEBUG﹕ pid: 5937, tid: 5957, name: Thread-2488  >>> com.games.game <<<
09-13 10:39:24.946      254-254/? I/DEBUG﹕ signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-13 10:39:25.096      254-254/? I/DEBUG﹕ r0 00000000  r1 00001745  r2 00000006  r3 00000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ r4 00000006  r5 00000000  r6 00001745  r7 0000010c
09-13 10:39:25.096      254-254/? I/DEBUG﹕ r8 00077b96  r9 79a22f28  sl 7980fa58  fp 79b20830
09-13 10:39:25.096      254-254/? I/DEBUG﹕ ip 7968cce2  sp 79b20560  lr 400e71ad  pc 400f6154  cpsr 000f0010
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d0  0000000000000000  d1  0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d2  0000000000000000  d3  0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d4  4026000000000000  d5  4026000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d6  4026000000000000  d7  0000000b00000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d8  0000000000000000  d9  0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d10 0000000000000000  d11 0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d12 0000000000000000  d13 0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d14 0000000000000000  d15 0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d16 6361667275534c47  d17 616a2e7765695665
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d18 3f80000000000000  d19 0000000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d20 0000000000000000  d21 000000003f800000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d22 0000000000000000  d23 3f80000000000000
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d24 3f6dcabc4571abc1  d25 3f30837711244472
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d26 3f4375429245411f  d27 3f133abc51b768d7
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d28 3f1420ec8fb87f66  d29 bef375cbdb605373
09-13 10:39:25.096      254-254/? I/DEBUG﹕ d30 c3f6625ec3f6625e  d31 3fd5555555555563
09-13 10:39:25.096      254-254/? I/DEBUG﹕ scr 80000012
09-13 10:39:25.096      254-254/? I/DEBUG﹕ backtrace:
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #00  pc 00022154  /system/lib/libc.so (tgkill+12)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #01  pc 000131a9  /system/lib/libc.so (pthread_kill+48)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #02  pc 000133bd  /system/lib/libc.so (raise+10)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #03  pc 000120f3  /system/lib/libc.so
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #04  pc 00021a08  /system/lib/libc.so (abort+4)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #05  pc 0004963f  /system/lib/libdvm.so (dvmAbort+78)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #06  pc 0004dfa7  /system/lib/libdvm.so (dvmDecodeIndirectRef(Thread*, _jobject*)+146)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #07  pc 0004f06b  /system/lib/libdvm.so
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #08  pc 00b252c4  /data/app-lib/com.games.game-1/libcocos2dcpp.so (_JNIEnv::GetStaticMethodID(_jclass*, char const*, char const*)+72)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #09  pc 00b251d0  /data/app-lib/com.games.game-1/libcocos2dcpp.so (cocos2d::JniHelper::getStaticMethodInfo(cocos2d::JniMethodInfo_&, char const*, char const*, char const*)+284)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #10  pc 00b1d984  /data/app-lib/com.games.game-1/libcocos2dcpp.so (cocos2d::Application::setAnimationInterval(double)+96)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #11  pc 00ee6bfc  /data/app-lib/com.games.game-1/libcocos2dcpp.so (cocos2d::DisplayLinkDirector::startAnimation()+116)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #12  pc 00ee4bf0  /data/app-lib/com.games.game-1/libcocos2dcpp.so (cocos2d::Director::runWithScene(cocos2d::Scene*)+380)
09-13 10:39:25.096      254-254/? I/DEBUG﹕ #13  pc 009dd260  /data/app-lib/com.games.game-1/libcocos2dcpp.so (AppDelegate::applicationDidFinishLaunching()+1632)

Push. 10 characters.

Make function like

public static boolean isGameCenterDisabled() {
    
    int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(_appActivity);
    
    if (status == ConnectionResult.SUCCESS){ return false;}
    
    return true;
    
}

After that before calling any google play services function make check if google play services are supproted on this device like this:

public static void initGameServices() {
    if (!isGameCenterDisabled()) {
        nativeInitGPGS(_appActivity);
        nativeOnActivityCreated(_appActivity, bundl);
    }
}

I’m not calling anything inside the Google Play services lib manually. I’m aware of the said check.

Google Play services out of date. Requires 7895000 but found 7571038
for me it looks that you are trying to use google play services…

Yes, that is correct. Google Play Services is integrated, iirc it was required by some plugin from SDKBox.

Btw I would recomend to not use latest google play services, it’s requiring to be compiled against android version 23… and can cause issue on older devices itslef. use older versions… like 7.3 or even 6.5…

SKDBOX picking by default from android sdk gpg versions and if u updated sdk it will pick latest, not always best choice…

Ok, I always thought Google Play is fully backwards compatible. Seems like it’s not. Thanks, I’m going with 6.5.87, since it’s the first version the splitting is available.

Thank you.

Have you tried using our Cocos Helper which has Google Play Services built in, along with setup videos http://www.sonarsystems.co.uk/cocoshelper.php