2015-07-21 99 views

回答

0
錯誤

要添加此庫:

使用Eclipse:

創建基於支持庫代碼庫項目:

Make sure you have downloaded the Android Support Library using the SDK Manager. 
1. Create a library project and ensure the required JAR files are included in the project's build path: 
    2. Select File > Import. 
    3. Select Existing Android Code Into Workspace and click Next. 
    4. Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the appcompat project, browse to <sdk>/extras/android/support/v7/appcompat/. 
    5. Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat. 
    6. In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path. 
    7. Right-click the library project folder and select Build Path > Configure Build Path. 
    8. In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files. 
    9. Uncheck Android Dependencies. 
    10.Click OK to complete the changes. 

您現在有一個用於選定支持庫的庫項目,可以與一個或多個應用程序項目一起使用。

庫添加到您的應用程序項目:

  1. 在Project Explorer中,右鍵單擊您的項目並選擇屬性。
  2. 在對話框左側的類別面板中,選擇Android。
  3. 在「庫」窗格中,單擊「添加」按鈕。
  4. 選擇庫項目並單擊確定。例如,appcompat項目應該被列爲android-support-v7-appcompat。
  5. 在屬性窗口中,單擊確定。

使用過Android Studio:

Make sure you have downloaded the Android Support Repository using the SDK Manager. 


1. Open the build.gradle file for your application. 
2. Add the support library feature project identifier to the dependencies section. For example, to include the appcompat project add compile "com.android.support:appcompat-v7:18.0.+" to the dependencies section, as shown in the following example: 

dependencies { 
    ... 
    compile "com.android.support:appcompat-v7:18.0.+" 
} 
+0

我的錯誤按照上面提到的步驟,但仍然android.support庫無法在我的項目中解決...謝謝 –

+0

使用Android Studio,你應該提供一個更新的例子。 18.0 +很老... –

+0

這只是一個例子,可以根據需要進行修改。參考 - developer.android.com –

1
在你的項目屬性

改變你的目標android-21.you應該有最新的API 21 SDK平臺

+0

嘗試在示例 –

+1

中打開project.properties,然後更改target = android-21 –

相關問題