2017-05-15 1 views
0

Zugabe begann ich habe java.lang.NoClassDefFoundError: für zufällige Klasse bekommen und dass Klassenänderungen auf jeder meiner Mitspieler Maschine und es geschieht nur für 5.x Geräte testeten wir auf 6.0 und 7.0 aber alles funktioniert es gut. Diese begann nach Zugabe geschieht 'com.android.support.constraint:constraint-layout:1.0.2' Wir entscheiden mit Constraint-Layout in App zu starten, und seitdem sind wir immer diese FehlermeldungAndroid NoClassDefFoundError nach Constraint Layout

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
     mavenCentral() 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 
apply plugin: 'realm-android' 


repositories { 
    maven { url 'https://maven.fabric.io/public' } 
    maven { url "https://jitpack.io" } 
    maven { url 'https://zendesk.artifactoryonline.com/zendesk/repo' } 
} 
def minSdk = hasProperty ('minSdk') ? minSdk : 19 

//for debug builds add username to version as suffix 
def username = readVersion() 

android { 
    compileSdkVersion 25 
    buildToolsVersion '25.0.0' 

    dataBinding { 
     enabled = true 
    } 
    lintOptions { 
     abortOnError false 
     disable 'MissingTranslation' 
     disable 'ExtraTranslation' 
    } 
    defaultConfig { 
     applicationId "xxx.xxxx.xxxxxx" 
     minSdkVersion minSdk 
     targetSdkVersion 25 
     maxSdkVersion 25 
     versionCode 27 
     versionName "0.0.00" 
     multiDexEnabled true 
     vectorDrawables.useSupportLibrary = true 

     ndk { 
      abiFilters "armeabi-v7a", "x86","armeabi" 
     } 

     packagingOptions { 
      exclude "lib/arm64-v8a" 
     } 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      shrinkResources true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      debuggable false 
     } 
     debug { 
      minifyEnabled false 
      debuggable true 
      versionNameSuffix "${username}" 
     } 

    } 
    dexOptions { 
     incremental true 
     javaMaxHeapSize "4g" 
    } 

    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' 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:25.2.0' 
    compile 'com.android.support:cardview-v7:25.2.0' 
    compile 'com.android.support:appcompat-v7:25.2.0' 
    compile 'com.android.support:design:25.2.0' 
    compile 'com.android.support:support-v4:25.2.0' 
    compile 'com.android.support:support-v13:25.2.0' 
    compile 'com.google.android.gms:play-services-gcm:10.2.0' 
    compile 'com.google.android.gms:play-services-maps:10.2.0' 
    compile 'com.google.android.gms:play-services-auth:10.2.0' 
    compile 'com.google.android.gms:play-services-location:10.2.0' 
    compile 'com.google.android.gms:play-services-places:10.2.0' 
    compile 'com.google.android.gms:play-services-plus:10.2.0' 
    compile 'com.google.maps.android:android-maps-utils:0.5' 
    compile 'com.google.http-client:google-http-client-gson:1.19.0' 
    compile 'com.pkmmte.view:circularimageview:1.1' 
    compile 'com.github.rahatarmanahmed:circularprogressview:2.5.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    //image picker 
    compile 'com.soundcloud.android:android-crop:[email protected]' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.github.johnkil.android-appmsg:appmsg:1.2.0' 
    compile 'cn.pedant.sweetalert:library:1.3' 
    compile 'com.mobsandgeeks:android-saripaar:2.0.2' 
    compile 'com.github.jd-alexander:library:1.1.0' 
    compile 'com.squareup.retrofit2:retrofit:2.1.0' 
    compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
    compile 'com.google.code.gson:gson:2.7' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    //expandable textview 
    compile 'com.ms-square:expandableTextView:0.1.4' 
    //favourite button 
    compile 'com.github.ivbaranov:materialfavoritebutton:0.1.2' 
    compile 'org.osmdroid:osmdroid-mapsforge:5.5:[email protected]' 
    compile 'org.mapsforge:mapsforge-map-android:0.6.1' 
    // compile 'org.mapsforge:mapsforge-map:0.6.1' //not in use 
    compile 'com.pubnub:pubnub:4.2.0' 
    compile 'com.github.fernandodev.easyratingdialog:easyratingdialog:+' 
    compile 'com.zopim.android:sdk:1.3.2.1' 
    compile 'com.zendesk:sdk:1.7.3.1' 
    compile files('libs/YouTubeAndroidPlayerApi.jar') 
    compile 'com.zopim.android:sdk:1.3.2.1' 
    compile 'com.zendesk:sdk:1.7.3.1' 
    // Android SDK 
    compile 'com.facebook.android:facebook-android-sdk:4.+' 
    /*// Audience Network SDK. Only versions 4.6.0 and above are available 
    compile 'com.facebook.android:audience-network-sdk:4.+' 
    // Account Kit 
    compile 'com.facebook.android:account-kit-sdk:4.+'*/ 
    // compile 'net.ypresto.androidtranscoder:android-transcoder:0.2.0' 

    // compile 'com.github.arimorty:floatingsearchview:1.1.2' 
    compile 'com.flurry.android:analytics:6.4.2' 
    //Webview dependancy 
    compile 'com.thefinestartist:finestwebview:1.2.7' 
    //autofit textview 
    compile 'me.grantland:autofittextview:0.2.+' 
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' 
    //compile 'com.facebook.android:facebook-android-sdk:3.21.1' 
    //video compression 
    compile project(':ffmpeg4android_lib') 
    compile files('libs/SCTNotifier.jar') 

    compile "com.mixpanel.android:mixpanel-android:5.+" 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.maps.android:android-maps-utils:0.5+' 
} 

String readVersion() { 
    def version = "whoami".execute().text.trim() 
    version = version.replace("\\", ".") 
    version = version.replace(" ", ".") 
    return "_reboot_" + version 
} 

Update: Ich habe die Einschränkung entfernt Layout von XML und entfernt diese Zeile: compile 'com.android.support.constraint: constraint-layout: 1.0.2' Und jetzt App funktioniert gut.

+0

Was ist * Klassenpfad Version * in Ihrer * build.gradle * Datei? Poste hier deine * build.gradle * Datei. –

+0

Bitte posten Sie die gesamte Fehlermeldung. –

+0

@jaydroider hinzugefügt build.gradle, und was meinst du mit Classpath? Meinst du, Grape an der Wurzel? es ist Klassenpfad 'com.android.tools.build:gradle:2.3.2' – chin87

Antwort

0

Vier Gründe sind NoClassDefFoundError in android erzeugen:

1) The class is not available in Java Classpath. 

2) You might be running your program using jar command and class was not defined in manifest file's ClassPath attribute. 

3) Any start-up script is overriding Classpath environment variable. 

4) Because NoClassDefFoundError is a subclass of java.lang.LinkageError it can also come if one of it dependency like native library may not available. 

Vor Build apk Ihr Projekt reinigen.

+0

Es passiert nur auf 5.x-Geräten, 6.x und 7.x funktioniert es gut. – chin87

+0

in der letzten Zeile sagte ich, reinigen Sie immer Ihr Projekt, bevor Sie Ihre apk bauen. Dieser Fehler kann auch im Falle eines sofortigen Laufs auftreten. –

Verwandte Themen