Didn't find class "android.support.v7.widget.RecyclerView"
是因為android.support.v4的版本不匹配的問題,android.support.v4的版本不匹配的問題,android.support.v4的版本不匹配的問題
重要的事情說三遍
Ubuntu + Eclipse, android sdk路徑:/home/steven/android-sdk-linux
再學習使用RecyclerView,按照教程的Demo,在Eclipse裡重寫了一遍。在模擬器上執行出錯。
提示 Didn't find class "android.support.v7.widget.RecyclerView".
首先你要把android.support.v7.widget.RecyclerView.jar這個包通過右鍵專案properties->java bulid path->libraries->add external jars加進去。我的android.support.v7.widget.RecyclerView.jar路進在/home/steven/android-sdk-linux/extras/android/support/v7/recyclerview/libs下。
然後在order and export裡面勾選上android.support.v7.widget.RecyclerView.jar(釋出的時候複製過去)
這時候再在模擬器上執行,還是提示錯誤: Didn't find class "android.support.v7.widget.RecyclerView".
這是因為android.support.v4的版本不匹配的問題,android.support.v7.widget.RecyclerView.jar會引用android.support.v4,但是它依賴的是android-sdk-linux/extras/android/support/v4/android.support.v4.jar,右鍵專案properties->java bulid path->libraries找到
android.support.v4.jar刪除它,重新add external jars,我的路徑是/home/steven/android-sdk-linux/extras/android/support/v4/android.support.v4.jar,最好在order and export裡把android.support.v4也勾選上。
轉自:http://blog.csdn.net/tingyuanss/article/details/45893661
相關文章
- 【BUG系列】multiDexEnabled true 不能亂寫啊,ClassNotFoundException: Didn't find class "***IDEException
- 記一次 報錯:Android ClassNotFoundException: Didn't find class on pathAndroidException
- Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskMIT
- Could not find the main class. Program will exitAI
- Android:Unable to find explicit activity classAndroid
- 100 Things You Probably Didn't Know About Oracle DatabaseOracleDatabase
- vncserver: couldn't find "xauth" on your PATHVNCServer
- jar檔案could not find the main class解決JARAI
- vncserver: couldn't find "xauth" on your PATH.VNCServer
- 在泛型中得到T.class泛型
- Supervisor 解決 can't find command *
- eslint --fix 報錯 can't not find modulesEsLint
- 解決can't find -lGL的問題
- 2008.1.15 He didn't know it until I put a bug in his ear.
- Flutter雜症(couldn't find "libflutter.so")Flutter
- 有用過grpc的嗎?Couldn't find descriptorRPC
- Android Studio:couldn't find .so檔案Android
- cordova 解決can’t not find moudle " plugman platform ios"PlatformiOS
- 【vnc】vncserver: couldn't find "xauth" on your PATH 問題VNCServer
- 請教:castor MappingException: Could not find the class異常ASTAPPException
- java.lang.IllegalArgumentException: Could not find class異常解決方式JavaException
- Can't find keyplane that supports type 4 for keyboard iPhone PortraitTiPhoneAI
- Starting MySQL * Couldn't find MySQL server (/usr/bin/mysqld_safe)MySqlServer
- java編譯 Error: Could not find or load main class java執行包main方法Java編譯ErrorAI
- OSError: [E050] Can‘t find model ‘en_core_web_sm‘. It doesn‘t seem to be a shortcut link, a Python pErrorWebPython
- 解決Error (1133): Can’t find any matching row in the user tableError
- "Error: Can't find libjava.so" 9.2.0.4 on RH 4.0 x86-64ErrorJava
- J2SE - Could not find the main class: xxx.xxx.Program will exitAI
- 【MAC版】Eclipse中啟動genymotion虛擬機器 顯示:Android ADB server didn't ACK 解決辦法MacEclipse虛擬機AndroidServer
- 無法找到註冊驅動Did not find registered driver with class com.mysql.jdbc.DriverMySqlJDBC
- Can't find the 'libpq-fe.h header when trying to install pg gemHeader
- java.util.MissingResourceException: Can't find resource for bundle oracle.sysman.db.rsc.LoginResourcJavaExceptionOracle
- 啟動infobright的時候遇見Can't find file: './mysql/host.frm'MySql
- 辛星淺析ruby下的mkmf.rb can't find header files for ruby atHeader
- crontab執行jar包時,Could not find or load main class(找不到或者載入不到主類)JARAI
- springboot專案打包提示Unable to find a single main class from the following candidates錯誤Spring BootAI
- swing程式打成jar包,執行出現(could not find the main class)問題,請高手指點!!JARAI
- Java5泛型的用法,T.class的獲取和為擦拭法Java泛型