Java 添加库时未找到ClassDefNotFound
我正在添加用于加载动画的库,但无论我添加了什么库,我都会在xml的预览部分获取ClassDefNotFound exception和ClassNotFound exception,同时在projectName for tools:context中获取找不到上下文的标识符 这是我的应用程序Java 添加库时未找到ClassDefNotFound,java,android,exception,nullpointerexception,libraries,Java,Android,Exception,Nullpointerexception,Libraries,我正在添加用于加载动画的库,但无论我添加了什么库,我都会在xml的预览部分获取ClassDefNotFound exception和ClassNotFound exception,同时在projectName for tools:context中获取找不到上下文的标识符 这是我的应用程序 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defau
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
哪些类出现错误?异常详细信息java.lang.ClassNotFoundException:pl.tajchert.waitingdots.R$styleable该库是否可以作为AAR提供,因为您需要它的资源?不知道,请看一看也尝试过我不确定,但是文档似乎表明,简单地包含一行gradle依赖项应该是可行的。你可以尝试升级你的Android Studio和Gradle版本