0

I am getting the below error message when using Microsoft java client for signalR (like mentioned here) and trying to build an apk from my source code in android studio.

ERROR

Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lmicrosoft/aspnet/signalr/client/Action;

Some information of my tools

Android studio 2.1.2
compileSdkVersion 23
buildToolsVersion "23.0.1"
minSdkVersion 14
targetSdkVersion 23
gradle version : 2.1.2
repository: maven

I am new to android development and didn't know exactly what type of information may be needed to find the problem.

Community
  • 1
  • 1
farid bekran
  • 2,684
  • 2
  • 16
  • 29

1 Answers1

0

You should modify the module-level build.gradle file configuration to include the support library and enable multidex output, as shown in the following code snippet:

android {
  ...

defaultConfig {
    ...

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

In your manifest add the MultiDexApplication in

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
    ...
    android:name="android.support.multidex.MultiDexApplication">
    ...
</application>

SofDroid
  • 5,450
  • 2
  • 13
  • 16