添加库时ClassDefNotFound

时间:2017-06-03 17:48:46

标签: java android exception nullpointerexception libraries

我正在添加用于加载动画的库,但是我添加的任何库都会在xml的预览部分中获得ClassDefNotFound异常和ClassNotFound异常,也无法在projectName中找到工具的上下文标识符:context 这是我的app.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
    applicationId "appname"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt')
,'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.github.tajchert:WaitingDots:0.4.0'
}

我正在使用android studio 1.2

The following classes could not be instantiated:
- com.wang.avi.AVLoadingIndicatorView (Open Class, Show Exception, 
Clear   Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or 
show sample data when shown in the IDE
Exception Details java.lang.NoClassDefFoundError: com/wang/avi/R$style

0 个答案:

没有答案