android-support-v7-appcompat的配置使用
2013-11-07 08:24
435 查看
直接将android-support-v7-appcompat.jar包拷贝到项目的libs/下面是不能使用的,具体做法官方文档给出了详细说明:
(开发环境是ADT)
Using Eclipse
Create a library project based on the support library code:
Make sure you have downloaded the Android Support Library using the SDK Manager.
Create a library project and ensure the required JAR files are included in the project's build path:
Select File > Import.
Select Existing Android Code Into Workspace and click Next.
Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the
Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
In the new library project, expand the
Right-click the project and select Build Path > Configure Build Path.
In the Order and Export tab, check the
Uncheck Android Dependencies.
Click OK to complete the changes.
You now have a library project for your selected Support Library that you can use with one or more application projects.
Add the library to your application project:
In the Project Explorer, right-click your project and select Properties.
In the Library pane, click Add.
Select the library project and click OK. For example, the
In the properties window, click OK.
(开发环境是ADT)
Using Eclipse
Create a library project based on the support library code:
Make sure you have downloaded the Android Support Library using the SDK Manager.
Create a library project and ensure the required JAR files are included in the project's build path:
Select File > Import.
Select Existing Android Code Into Workspace and click Next.
Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the
appcompatproject, browse to
<sdk>/extras/android/support/v7/appcompat/.
Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
In the new library project, expand the
libs/folder, right-click each
.jarfile and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the
android-support-v4.jarand
android-support-v7-appcompat.jarfiles to the build path.
Right-click the project and select Build Path > Configure Build Path.
In the Order and Export tab, check the
.jarfiles you just added to the build path, so they are available to projects that depend on this library project. For example, the
appcompatproject requires you to export both the
android-support-v4.jarand
android-support-v7-appcompat.jarfiles.
Uncheck Android Dependencies.
Click OK to complete the changes.
You now have a library project for your selected Support Library that you can use with one or more application projects.
Add the library to your application project:
In the Project Explorer, right-click your project and select Properties.
In the Library pane, click Add.
Select the library project and click OK. For example, the
appcompatproject should be listed as android-support-v7-appcompat.
In the properties window, click OK.
相关文章推荐
- IDEA / Android studio 使用gradle 编译 Failed to resolve: com.android.support:appcompat-v7:27.+
- 关于android-support-v7-appcompat.jar的使用的一些问题和解决方法
- 如何使用android-support-v7-appcompat
- Android Studio不能运行程序,提示信息:Error: Failed to resolve: com.android.support:appcompat-v7:27.+ <a hr
- 引用android-support-v7-appcompat库文件出错的问题
- android studio appcompat-v7:22.0.0包与support-v4:22.0.0包问题
- Failed to resolve:com.android.support:appcompat-v7:报错处理
- Amdroid 开发报错 Failed to resolve: com.android.support:appcompat-v7:27.+ 解
- 解决Android Studio打开别人包时出现Failed to find: com.android.support:appcompat-v7:21.
- Failed to find: com.android.support:appcompat-v7:22.0.0报错解决
- could not find com.android.support.appcompat-v7:23.4.0
- Error:(39, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.0 [duplicate]
- Failed to resolve: com.android.support:appcompat-v7:27.+问题解决
- failed to resolve com.android.support:appcompat-v7:23+ 解决方法
- failed to resolve: com.android.support:appcompat-v7:25.4.0
- failed to resolve: com.android.support:appcompat-v7:25.4.0解决办法
- 为什么 compile 'com.android.support:appcompat-v7:25.0.1' 执行后会在External libraries里引入很多个jar包
- Android support library appcompat v7: cannot find actionModeShareDrawable resource
- Error:(37, 13) Failed to resolve: com.android.support:appcompat-v7:26 <a href="install.m2.repo">Inst
- com.android.support:appcompat-v7:15.+. Versions do not match解决办法 android studio