简体   繁体   English

Eclipse ADT appcompat ......它是什么?

[英]Eclipse ADT appcompat… what is it?

I've spent all afternoon getting absolutely nowhere with this. 我整个下午都花了这么多时间。 I've downloaded Eclipse, downloaded the SDK, installed the updates, but every new Android project I create something's wrong. 我已经下载了Eclipse,下载了SDK,安装了更新,但每个新的Android项目我创建了一些错误。

Firstly, it would not generate the R.java file, at all, now it does but there's a separate project it's created automatically called appcompat_v7. 首先,它根本不会生成R.java文件,现在它确实生成了但是有一个单独的项目,它自动创建名为appcompat_v7。 I don't know what this is, but it's causing problems with any other new project. 我不知道这是什么,但它导致任何其他新项目的问题。

This is the error a normal project produces: The container 'Android Dependencies' references non existing library '/home/omar/workspace/appcompat_v7/bin/appcompat_v7.jar' 这是正常项目产生的错误:容器'Android Dependencies'引用非现有库'/home/omar/workspace/appcompat_v7/bin/appcompat_v7.jar'

I have absolutely no idea how to fix this. 我完全不知道如何解决这个问题。 What is causing this? 是什么造成的?

EDIT It appear this is only with KitKat, every other API platform doesn't produce ANY source files at all.... any idea how to combat this? 编辑它似乎只有KitKat,每个其他API平台根本不生成任何源文件....任何想法如何打击这个?

在此输入图像描述

在此输入图像描述

在此输入图像描述

It's a support library which presumably your project refers to. 这是一个支持库,大概是你的项目所指的。 You will need to build it as a library project in your workspace. 您需要在工作区中将其构建为库项目。 This process is described here Support Library Setup under Adding libraries with resources . 此过程在此处描述了使用资源添加库下的支持库设置

You will find the project you need to copy in your SDK in the folder: 您将在文件夹中的SDK中找到需要复制的项目:

\\yourSDKlocation\\tools\\android-sdk-windows4.4\\extras\\android\\support\\v7\\appcompat \\ yourSDKlocation \\ TOOLS \\ Android的SDK-windows4.4 \\演员\\机器人\\ SUPPORT \\ V7 \\程序兼容性

(It's no use just copying a jar, you must build it as a library project.) (仅仅复制一个jar是没用的,你必须将它构建为一个库项目。)

I had this problem when I moved a project to a different laptop. 当我将项目移动到另一台笔记本电脑时,我遇到了这个问题。 I solved it like this: 我这样解决了:

If appcompat_v7 is not available in Eclipse: From the File menu, choose New then Project. 如果Eclipse中没有appcompat_v7:从File菜单中选择New,然后选择Project。 Next, choose Android and Android Project from existing Code, then click next Browse to find your appcompat_v7 project folder Make sure there's a check mark next it in the 'Projects to Import' list If the appcompat_v7 project folder is not currently in your workspace, select 'Copy projects into workspace', then click Finish 接下来,从现有代码中选择Android和Android Project,然后单击下一步浏览以找到appcompat_v7项目文件夹确保“要导入的项目”列表中的旁边有一个复选标记如果appcompat_v7项目文件夹当前不在您的工作区中,请选择'将项目复制到工作区',然后单击完成

Now that the library project is available in your workspace, it can be added to a project: Choose your project from the Project Explorer and open the project properties (on a mac it's in the Project menu) Click on Android in the left list Next to the Library list, click the Add button Choose appcompat_v7 from the list 现在您的工作区中可以使用库项目,它可以添加到项目中:从Project Explorer中选择项目并打开项目属性(在项目菜单中的Mac上)单击左侧列表中的Android在Library列表中,单击Add按钮从列表中选择appcompat_v7

You should be good to go now. 你现在应该好好去。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM