如何在netbeans中将appcompat库添加到android项目中? [英] How do I add the appcompat library to an android project in netbeans?
问题描述
我通过SDK管理器安装了支持库.
I have the support libraries installed via the SDK manager.
我已将C:\ Program Files \ Android \ android-sdk \ extras \ android \ support \ v7 \ appcompat文件夹复制到我的项目libs文件夹中.
I have copied the C:\Program Files\Android\android-sdk\extras\android\support\v7\appcompat folder to my projects libs folder.
我已经将sdk的\ tools文件夹添加到了我的命令行路径.然后我跑了
I have added the \tools folder of the sdk to my command line path. I have then run
android update project --path . --library C:\Users\srayner\dev\android\AndroidTest1\libs\appcompat
但是现在netbeans给了我这个错误;
But now netbeans gives me this error;
无法解析库路径:C:\ Users \ srayner \ dev \ android \ AndroidTest1 \ libs \ appcompat
Failed to resolve library path: C:\Users\srayner\dev\android\AndroidTest1\libs\appcompat
在netbeans中设置带有支持项的android支持库的正确方法是什么?
What is the correct method to setup an android support library with resouses in netbeans?
推荐答案
我已经成功构建并在NetBeans中添加了appcompat项目.
I have successfully build and added the appcompat project in NetBeans.
- 在netbeans中创建一个新的android项目-我将其称为"appcompat".
- 构建新项目,只需确保可以成功构建.
- 删除src目录中的所有内容并重新生成.我的项目仅包含NetBeans创建的默认MainActivity.您不需要它.
- 导航到您的android sdk安装目录 "androidSdkPath \ extras \ android \ support \ v7 \ appcompat并复制所有 该文件夹中的内容
- 将复制的内容粘贴到您的android项目中 在步骤1中创建(再次将我的名称命名为appcompat).
- 非常重要-打开project.properties,并确保"target"属性与以下内容匹配:"target = android-21"
- 构建您的项目,瞧,您应该一切准备就绪.
- 如果您在使用appcompat库编译项目时仍然遇到问题,请更改项目库属性target = android-21"
- Create a new android project in netbeans - I called mine "appcompat".
- Build your new project just make sure it can be successfully build.
- Delete everything inside the src directory and rebuild. My project just contained the default MainActivity that was created by NetBeans. You don't need it.
- Navigate to your android sdk install directory "androidSdkPath\extras\android\support\v7\appcompat and copy all the contents within that folder
- Paste the copied contents to the android project that you created in step 1 (again mine was named as appcompat).
- Very important - Open project.properties and ensure that the "target" property matches the following: "target=android-21"
- Build your project and Voila... you should be all set.
- If you are still having issues compiling the project that will be using the appcompat library, change your project library properties target=android-21"
这篇关于如何在netbeans中将appcompat库添加到android项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!