How to fix: java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory
<p>I have an project which includes a libraryproject.
My main project has the following dependencies: </p>

<pre><code>dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':foundationclasses')
    compile 'com.android.support:multidex:'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'

    //NEUROTECHNOLOGY
    compile files('libs/neurotec-media-android.jar')
    compile files('libs/neurotec-media-processing-android.jar')
    compile files('libs/neurotec-licensing-gui-android.jar')
    compile files('libs/neurotec-licensing-android.jar')
    compile files('libs/neurotec-gui-android.jar')
    compile files('libs/neurotec-devices-android.jar')
    compile files('libs/neurotec-core-android.jar')
    compile files('libs/neurotec-cluster-android.jar')
    compile files('libs/neurotec-biometrics-gui-android.jar')
    compile files('libs/neurotec-biometrics-client-android.jar')
    compile files('libs/neurotec-biometrics-android.jar')
    compile files('libs/jna.jar')
    compile files('libs/acra.jar')

    //CREDENCE
    compile files('libs/CredenceDeviceLib.jar')

    //OTHER
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'com.github.fengdai:alertdialogpro-theme-material:0.2.6'
    compile 'joda-time:joda-time:2.9.3'
    compile 'com.wang.avi:library:1.0.2'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
}
</code></pre>

<p>My library project`s dependencies: </p>

<pre><code>dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.guava:guava:18.0'
    compile 'com.github.tony19:logback-android-classic:1.1.1-4'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
}
</code></pre>

<p>gradlew app:dependencies  gives the following result:</p>

<pre><code>compile - Classpath for compiling the main sources.
+--- project :foundationclasses                                          
|    +--- com.google.guava:guava:18.0
|    +--- com.github.tony19:logback-android-classic:1.1.1-4
|    |    +--- com.github.tony19:apktool-lib:1.4.4-3
|    |    |    \--- com.google.android:android:2.1_r1
|    |    |         +--- commons-logging:commons-logging:1.1.1
|    |    |         +--- org.apache.httpcomponents:httpclient:4.0.1
|    |    |         |    +--- org.apache.httpcomponents:httpcore:4.0.1
|    |    |         |    +--- commons-logging:commons-logging:1.1.1
|    |    |         |    \--- commons-codec:commons-codec:1.3
|    |    |         +--- org.khronos:opengl-api:gl1.1-android-2.1_r1
|    |    |         +--- xerces:xmlParserAPIs:2.6.2
|    |    |         \--- xpp3:xpp3:1.1.4c
|    |    \--- com.github.tony19:logback-android-core:1.1.1-4
|    \--- org.slf4j:slf4j-api:1.7.12
+--- com.android.support:multidex: FAILED
+--- com.android.support:appcompat-v7:23.3.0
|    +--- com.android.support:support-vector-drawable:23.3.0
|    |    \--- com.android.support:support-v4:23.3.0
|    |         \--- com.android.support:support-annotations:23.3.0
|    +--- com.android.support:animated-vector-drawable:23.3.0
|    |    \--- com.android.support:support-vector-drawable:23.3.0 (*)
|    \--- com.android.support:support-v4:23.3.0 (*)
+--- cn.pedant.sweetalert:library:1.3
|    \--- com.pnikosis:materialish-progress:1.0
|         \--- com.android.support:appcompat-v7:21.0.0 -&gt; 23.3.0 (*)
+--- com.github.fengdai:alertdialogpro-theme-material:0.2.6
|    +--- com.nineoldandroids:library:2.4.0
|    \--- com.github.fengdai:alertdialogpro-core:0.2.6
|         \--- com.android.support:appcompat-v7:23.1.1 -&gt; 23.3.0 (*)
+--- joda-time:joda-time:2.9.3   
+--- com.wang.avi:library:1.0.2  
|    +--- com.android.support:appcompat-v7:22.2.0 -&gt; 23.3.0 (*)
|    \--- com.nineoldandroids:library:2.4.0
\--- org.slf4j:slf4j-api:1.7.12  
</code></pre>

<p>Error log:</p>

<pre><code>java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory
at nl.hsb.abis.fsm.ActivityController.&lt;clinit&gt;(ActivityController.java:33)
at nl.hsb.finalapplication.MainActivity.onCreate(MainActivity.java:21)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2293)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5289)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)   
</code></pre>

<p>I have tried everything but i cant get rid of this error, any advice would be greatly appreciated!</p>