Android game crashes at the start in Android 4.4, api level 19 devices

My game crashes at the start :frowning: in almost all devices with Android 4.4.x (api level 19) devices. Please help! @pabitrapadhy, @nite
It crashes with both js and c++ versions.

infos:
Cocos2dx version: 3.14.1
compileSdkVersion 22
buildToolsVersion “22.0.1”
minSdkVersion 10
targetSdkVersion: have tried with 19, 22, 23

used sdkbox plugins : appodeal

[Edit: Compiled through cocos console command line]

Below is the log:
java.lang.NoClassDefFoundError: com.sdkbox.plugin.SdkboxLog
at com.sdkbox.plugin.SDKBox.init(SDKBox.java:62)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:266)
at android.app.Activity.performCreate(Activity.java:5459)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2458)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5598)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)

Did you build with android studio?

Nope, as I said in the post, I am using command line.

Can you download the appodeal again and replace the sdkbox.jar from the package?

http://www.sdkbox.com/plugins/appodeal

But it’s working in Android 5 and greater versions. Only it didn’t work in 4.4 and lesser versions.
Ok I will try replacing the jar again.

Tried replacing the .jar file, it’s still the same. Doesn’t work in Android 4.4. :frowning:

There is really serious issue with Appodeal through sdkbox in cocos2dx 3.14.1.
I tried with admob through sdkbox, it works in Android 4.4 and above versions. It was working with targetsdkversion 19 and 23.

But when I try appodeal through sdkbox with targetsdkversion less than 23 it works in Android 5 and above but not in Android 4.4.
And another problem is the command line build doesn’t even work when I set targetsdkversion to 23 :frowning: .
My previous build has targetsdkversion 23, so I need to set same or higher. Now I’m really stuck here for a week and getting frustrated. @pabitrapadhy will you please help me out here ?

This infos I got in cocos console: [targetsdkversion 23, cocos2dx 3.14.1, appodeal]
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Unknown source file : at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
Unknown source file : at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
Unknown source file : at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
Unknown source file : at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
Unknown source file : at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file : at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
Unknown source file : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
Unknown source file : at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file : at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file : at com.android.dx.command.Main.main(Main.java:106)

You have more than 65k methods in your code. You’re probably using google play services as one package - use only modules that you need. From the other hand you can also use multidexing. But you have to use gradle build system anyway.

What I did was just imported appodeal (sdkbox import appodeal) and followed the manual process. sdkbox itself puts “google-play-services.jar” there and it’s lite version as per them.
I’m still kind of noob here, is gradle build applicable if I’m using cocos console command line ?

You have to use proj.android-studio (not proj.android). I’m not using SDKBOX (rather using native libraries and calling them by JNI), so I don’t know how exactly it’s working.

Yes I’m already doing that with --android-studio param in the command line.

@ryanjjj may I request you to have a look here please?

Is it possible for us to access your project? I think it’s likely a configuration issue.