mikepenz / Android-Iconics

Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
https://mikepenz.dev
Apache License 2.0
5.2k stars 615 forks source link

java.lang.NoClassDefFoundError #275

Closed DJphy closed 7 years ago

DJphy commented 7 years ago

Earlier I was using these

buildToolsVersion "25.0.1"
final SUPPORT_LIBRARY_VERSION = '25.1.0'

now updated to this

buildToolsVersion "25.0.3"
final SUPPORT_LIBRARY_VERSION = '25.3.1'

Which is resulting in run time exception is what I believe. stacktrace: java.lang.NoClassDefFoundError: com.mikepenz.entypo_typeface_library.Entypo$Icon code that's causing the issue: when trying to access Icon class Entypo.Icon.ent_chevron_thin_down

Current build.gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    defaultConfig {
        applicationId "co.appmastery.lycatv"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 7
        versionName "1.6"
        multiDexEnabled true;
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        jumboMode true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    final SUPPORT_LIBRARY_VERSION = '25.3.1'
    compile "com.android.support:leanback-v17:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:mediarouter-v7:$SUPPORT_LIBRARY_VERSION"
    compile 'com.android.support:support-v4:24.1.1'
    compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"

    compile "com.mixpanel.android:mixpanel-android:4.+"
    compile 'com.github.bumptech.glide:glide:3.4.+'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.squareup.okhttp3:okhttp:3.2.0'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.google.android.exoplayer:exoplayer:r2.4.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.github.androidquery:androidquery:0.26.9'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile "com.mikepenz:iconics-core:2.8.4@aar"
    compile 'com.mikepenz:google-material-typeface:3.0.1.0.original@aar'
    compile 'com.mikepenz:ionicons-typeface:2.0.1.2@aar'
    compile 'com.mikepenz:entypo-typeface:1.0.0.2@aar'
    compile 'com.mikepenz:community-material-typeface:1.9.32.1@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
    compile 'jp.wasabeef:blurry:2.1.0'
    compile 'com.mikhaellopez:circularimageview:3.0.2'
    compile 'com.github.rubensousa:gravitysnaphelper:1.0'
    compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
    compile 'com.google.guava:guava:20.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
    compile 'joda-time:joda-time:2.7'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services:10.2.4'
}
mikepenz commented 7 years ago

@DJphy are other icons working?

DJphy commented 7 years ago

hi Mike, Thanks for the reply are other icons working? I have not got a chance to check others but for Entypo its resulting in run time exception (NoClassDefFoundError).

mikepenz commented 7 years ago

@DJphy if you remove that icon set which is crashing. Will the others work?

DJphy commented 7 years ago

if you remove that icon set which is crashing. Will the others work? Others in the sense, the app drawables or the others like gmd, faw etc (other from your lib) Or your asking me to remove Entypo from Gradle and check for other Icon set from your lib

mikepenz commented 7 years ago

Remove entypo and use the GoogleMaterial one. Is it working or will it also crash?

DJphy commented 7 years ago

Okay I will check tat and reply, thnx

DJphy commented 7 years ago

I have figured out 1 more thing; For the same build.gradle file mentioned above, if I use these: (observe aar versions) Case 1

compile "com.mikepenz:iconics-core:2.8.4@aar"
compile 'com.mikepenz:google-material-typeface:3.0.1.0.original@aar'
compile 'com.mikepenz:ionicons-typeface:2.0.1.2@aar'
compile 'com.mikepenz:entypo-typeface:1.0.0.2@aar'
compile 'com.mikepenz:community-material-typeface:1.9.32.1@aar'

I observe a java.lang.ClassNotFoundException: android.support.v4.util.ArrayMap

Case 2

compile 'com.mikepenz:iconics-core:2.5.3@aar'
compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
compile 'com.mikepenz:ionicons-typeface:2.0.1.2@aar'
compile 'com.mikepenz:entypo-typeface:1.0.0.2@aar'
compile 'com.mikepenz:community-material-typeface:1.7.22.1@aar'

I observed the one I mentioned earlier, same happened for GoogleMaterial too

Also i suspect on this line too compile 'com.android.support:support-v4:24.1.1' I am using SUPPORT_LIBRARY_VERSION = '25.3.1' version for all others support lib dependency except for support-v4 since i couldn't find a support-v4 jar file versioned 25.3.1, the last updated version for support-v4 is 24.1.1

mikepenz commented 7 years ago

case 1 is incompatiblity of the support libs. you need to use 25.3.1 for everything. You are not supposed to have different versions. if you have different versions it will always fail.

And using the icon sets with an older version of the iconics lib could fail. I can not support this.

You could exclude the support libs of the iconics. http://stackoverflow.com/questions/21764128/how-do-i-exclude-all-instances-of-a-transitive-dependency-when-using-gradle

mikepenz commented 7 years ago

in addition why do you want the support-v4 as jar file?! it is included in the appcompat lib anyways

DJphy commented 7 years ago

hmm, thanks for update Mike, I will check further and will close this.