即使在Android studio中存在类,java.lang.NoClassDefFoundError也是如此
我在Android studio中面临支持库文件的NoClassDefFoundError,即使项目中有文件。我认为它的到来是因为支持自由党。我想我已经在项目中适当地包含了支持库。我就是这样补充的即使在Android studio中存在类,java.lang.NoClassDefFoundError也是如此,android,android-studio,Android,Android Studio,我在Android studio中面临支持库文件的NoClassDefFoundError,即使项目中有文件。我认为它的到来是因为支持自由党。我想我已经在项目中适当地包含了支持库。我就是这样补充的 apply plugin: 'com.android.application' repositories { mavenCentral() jcenter() mavenLocal() maven {
apply plugin: 'com.android.application'
repositories {
mavenCentral()
jcenter()
mavenLocal()
maven {
name 'maven.aviary.com'
url uri("http://maven.aviary.com/repo/release")
}
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.path"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
jumboMode true
javaMaxHeapSize "2g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile project(':Aviary-SDK')
compile project(':facebook')
}
错误:
java.lang.NoClassDefFoundError:com.path.SocialNetworkManager位于
com.path.fragments.SocialNetworkFragment.onCreateView(SocialNetworkFragment.j
ava:120)android.app.Fragment.performCreateView(Fragment.java:1700)
但我还是犯了错误。我在Facebook和Aviary SDk以及我的项目中使用了Support lib V4版本,这个错误是因为这个吗?如果是,如何解决这个问题,如何在androidstudio中为不同的模块分离相同的lib
请帮助我如果主项目中还没有支持lib,您应该只为其中一个在生成设置中选中导出,否则请同时取消选中这两个选项。您能告诉我如何操作(取消选中libs)。。我是Android studio和Gradle构建系统的新手。右键单击,进入项目属性>Java构建路径>顺序并导出错误消息看起来与支持库无关。它在
com.path
包中,而不是com.android.support
中。