android studio導jar包找不到類的解決方法


今天更新了universal-image-loader-1.9.5.jar文件,studio死活找不到其中相關的類,上網百度試了很多辦法,總算解決了,具體方法跟一篇老外的帖子的差不多,這里分享下。

 

解決步驟:

Something went wrong in incremental build system. One of this should help:

  1. Menu Build -> Rebuild project
  2. Delete folder /build
  3. Close Android Studio, delete /build folder
  4. Right click on your project -> "Open module settings" -> Dependencies tab -> check if Export is checked for your library

來自老外的帖子http://stackoverflow.com/questions/17724642/android-studio-java-lang-noclassdeffounderror  

 

參考文章:http://www.oschina.net/question/2263525_180149

 

這個問題經常發生在build.gradle如下配置的時候:

compile fileTree(dir: 'libs', include: ['*.jar'])

 

如果實在解決不了,就在build.gradle里面加上比如下面的引用,studio可能有時候發現不了jar包,加上下面的代碼就能騙過studio了,bulid成功后刪除就好了。

compile files('libs/umeng_social_sdk.jar')


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM