java.lang.ClassNotFoundException:没有在路径上找到类:DexPathList gradle:2.1.0-alpha1

时间:2016-03-10 14:35:42

标签: android android-studio android-gradle build.gradle gradle-plugin

所以,我有一个私人图书馆的项目。我的lib有一些我想在我的项目中使用的类,但当我执行应用程序并尝试访问该类时,它会发生异常:

  

处理:chat.omni.loja,PID:32615
  java.lang.NoClassDefFoundError:解析失败:   LCOM / omnichat / chat_library / _util / GaleryUtils;   引起:java.lang.ClassNotFoundException:没找到类" com.omnichat.chat_library._util.GaleryUtils"在路径上:DexPathList [[dex file" /data/data/chat.omni.loja/files/instant-run/dex/slice-slice_9_c46d74b6abb1c51e69093e6cb8bf4a5f5e9b987f-classes.dex" ;, dex file

     

...

     

" /data/data/chat.omni.loja/files/instant-run/dex/slice-dependencies_f7fd1358be3ac9af2f69ac6f15447a76a8be062c-classes.dex"],nativeLibraryDirectories = [/ vendor / lib,/ system / lib ,/ vendor / lib,/ system / lib]]                                                                       在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

这是我的库构建gradle:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  testCompile 'junit:junit:4.12'

  ext { supportLibVersion = '23.+' }

  //CircleImageView Library
  compile 'de.hdodenhof:circleimageview:2.0.0'
  compile "com.android.support:appcompat-v7:${supportLibVersion}"
  // SMACK Library
  compile 'org.igniterealtime.smack:smack-android-extensions:4.2.0-alpha3'
  compile 'org.igniterealtime.smack:smack-tcp:4.2.0-alpha3'
  //Glide Library
  compile 'com.github.bumptech.glide:glide:3.6.1'
  //SectionCursorAdapter Library
  compile 'com.twotoasters.SectionCursorAdapter:library:1.0.+'
  //Android Annotations Library
  compile "org.androidannotations:androidannotations-api:$AAVersion"
  //Android Annotations apt
  apt "org.androidannotations:androidannotations:$AAVersion"
}

我的应用程序构建了gradle:

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   testCompile 'junit:junit:4.12'

   ext { supportLibVersion = '23.+' }
   //Library dependency
   compile(project(':chat-library')) {
       exclude group: 'com.android.support', module: 'appcompat-v7';
       exclude group: 'org.androidannotations', module: "androidannotations:$AAVersion";
       exclude group: 'org.androidannotations', module: "androidannotations-api:$AAVersion";
   }

   //Supports Library
   compile "com.android.support:design:${supportLibVersion}"
   compile "com.android.support:cardview-v7:${supportLibVersion}"
   compile "com.android.support:recyclerview-v7:${supportLibVersion}"
   compile "com.android.support:support-v4:${supportLibVersion}"
   // Crashlytics Kit
   compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
       transitive = true
   }
   //Android Annotations Library
   apt "org.androidannotations:androidannotations:$AAVersion"
   compile "org.androidannotations:androidannotations-api:$AAVersion"
   //Parser Library
   compile 'com.parse:parseui-widget-android:0.0.1'
   compile 'com.parse.bolts:bolts-android:1.+'
   compile 'com.parse:parse-android:1.+'
   //Stetho Library
   compile 'com.facebook.stetho:stetho:1.2.0'
   //Material SearchView Library
   compile 'com.miguelcatalan:materialsearchview:1.+'
   //CropImage Library
   compile 'com.soundcloud.android:android-crop:1.0.0@aar'
}

我的配置是:

  • Android Studio 2.1预览1
  • Android Gradle Plugin' com.android.tools.build:gradle:2.1.0-alpha1'
  • 构建工具版本23.0.2
  • Gradle版本2.10

我用谷歌搜索了这个问题了2天,我尝试了所有我在SO上找到的东西。所以可能它可能是新gradle版本的错误,但我不能肯定。其他人有这个问题吗?

1 个答案:

答案 0 :(得分:0)

感谢Victor Gomes!你的提示很棒..我刚刚更新到 gradle-2.11 ,它又恢复了工作!