The Import android.support.v7 cannot be resolved

問題:


I am new to Android. Currently, I have the adt-bundle-windows-x86-20131030.zip (Windows 32 bit) installed - and have successfully installed the Android SDK and Eclipse. Also, I have updated everything in the Android SDK manager. Now, I am working in Android v-4.4.2

My project runs successfully, but when I import android.support.v7.app.ActionBarActivity; and import android.support.v7.app.ActionBar; the project won't debug. I get the error The Import android.support.v7 cannot be resolved

I searched in Google and installed Android Support Library then added v7 in my project.

  1. File->Import (android-sdk\extras\android\support\v7). Choose "appcompat"
  2. Project-> properties->Android. In the section library "Add" and choose "appCompat"

Screenshot

enter image description here

Successfully added in appCompat but still I am still getting the error.


解決方法:

 
  1. Go to your project in the navigator, right click on properties.

  2. Go to the Java Build Path tab on the left.

  3. Go to the libraries tab on top.

  4. Click add external jars.

  5. Go to your ADT Bundle folder, go to sdk/extras/android/support/v7/appcompat/libs.

  6. Select the file android-support-v7-appcompat.jar

  7. Go to order and export and check the box next to your new jar.

  8. Click ok.


轉自:http://stackoverflow.com/questions/24998368/the-import-android-support-v7-cannot-be-resolved

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章