weborb.types.Types error

Hi, I have been recently working on an app, which I was testing and running on android devices with API 21+.
Today I decided to check older versions of android to see how it works and I got the following error as soon as a I tried to register the app on backendless:

Process: net.crofis.wichat, PID: 7461
                                                                 java.lang.NoClassDefFoundError: weborb.types.Types
                                                                     at com.backendless.UserService.<init>(UserService.java:56)
                                                                     at com.backendless.UserService.<clinit>(UserService.java:47)
                                                                     at com.backendless.Backendless.<clinit>(Backendless.java:44)
                                                                     at net.crofis.wichat.WiChatApp.onCreate(WiChatApp.java:23)
                                                                     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                                                                     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4328)
                                                                     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:136)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5001)
                                                                     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:785)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                                     at dalvik.system.NativeStart.main(Native Method)

I have tried the following soulotions so far with no success:

  • Changing the heap size in gradle
  • replacing the backendless jar lib with maven dependency

Please specify which Backendless SDK from maven did you try and on which Android did the problem occur?

maven dependency: com.backendless:backendless:3.0.15.1

Android: I am using an Emulator by Genymotion, Samsung Galaxy S4 , running 4.4.4 (API 19)

Please share your manifest file

http://pastebin.com/ssb6QPTR

Try to explicitly specify SDK

I tried and nothing changed

UPDATE:
I tried removing google play services and it worked however this cannot be the fix because my app depends on some of the packages in the google play services.
I am not still not sure what to do.

UPDATE: Solution found
Ok so apparently I had over 64k methods which exceeds the normal dex limit, therefor I had to enable multidex in gradle, which is something I already have done.

I recently found out that android devices that are prior to 5.0.0 (21) do not support multi dex and therefor it would crash on anything below API 21.

The fix:
In the application file where I init the backendless configuration:

public class App extends MultiDexApplication{
...
}

In manifest:

<application
    android:largeHeap="true"
    android:name=".App"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

in app module:

defaultConfig {
    multiDexEnabled true
}
dependencies {
    compile 'com.android.support:multidex:1.0.0'
}