如何在netbeans中将appcompat库添加到android项目中? [英] How do I add the appcompat library to an android project in netbeans?

查看:73
本文介绍了如何在netbeans中将appcompat库添加到android项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过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.

  1. 在netbeans中创建一个新的android项目-我将其称为"appcompat".
  2. 构建新项目,只需确保可以成功构建.
  3. 删除src目录中的所有内容并重新生成.我的项目仅包含NetBeans创建的默认MainActivity.您不需要它.
  4. 导航到您的android sdk安装目录 "androidSdkPath \ extras \ android \ support \ v7 \ appcompat并复制所有 该文件夹中的内容
  5. 将复制的内容粘贴到您的android项目中 在步骤1中创建(再次将我的名称命名为appcompat).
  6. 非常重要-打开project.properties,并确保"target"属性与以下内容匹配:"target = android-21"
  7. 构建您的项目,瞧,您应该一切准备就绪.
  8. 如果您在使用appcompat库编译项目时仍然遇到问题,请更改项目库属性target = android-21"
  1. Create a new android project in netbeans - I called mine "appcompat".
  2. Build your new project just make sure it can be successfully build.
  3. 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.
  4. Navigate to your android sdk install directory "androidSdkPath\extras\android\support\v7\appcompat and copy all the contents within that folder
  5. Paste the copied contents to the android project that you created in step 1 (again mine was named as appcompat).
  6. Very important - Open project.properties and ensure that the "target" property matches the following: "target=android-21"
  7. Build your project and Voila... you should be all set.
  8. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆