与Android Maven的 - R.java文件生成(Eclipse中) [英] Maven with Android - R.java file generation (Eclipse)

查看:99
本文介绍了与Android Maven的 - R.java文件生成(Eclipse中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得工作R.java代根文件夹项目。事实上,应用程序构建,使用Maven构建的时候,但日食发现错误,因为它无法解析R.java文件(这实际上是被放在/target/generated-sources/r/R.java位置每个生成后) 。什么是建议的方式来解决这个问题呢?

解决方案

推荐的方法是使用 Maven的集成为Android开发工具和Maven的Andr​​oid插件提供了相关说明。从 Eclipse集成页:

  

简介

     

Android的官方发展工作   提供了Eclipse的固相载体   整合,我们想作   确保Maven的Andr​​oid的插件有助于桥   Maven的,Android和Eclipse的。这一页   将帮助我们收集的信息   什么工作,不工作

     

解决方案

     

让Maven,Android的插件,做工精良   在Eclipse中使用ADT,这就是你   需要:

     
      
  1. 转到 m2eclipse的机器人集成项目页面和   安装在列出的工具   要求。
  2.   
  3. 当然,成立了更新站点的URL,然后安装m2eclipse的安卓   集成插件在Eclipse中。 * 得到   版本0.2.2或更高版本。它应该是   该类别下的Maven的集成   对于Android开发工具。
  4.   
  5. 在Eclipse中,带给你的Maven的Andr​​oid项目,选择File - >   导入... - >的Maven - >现有的Maven   项目。
  6.   

于是跳到 m2eclipse的机器人集成项目页面然后向<一href="http://$c$c.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/wiki/GettingStarted">Getting入门指南非常详细的说明。

使用正确的工具,所生成的code中的目录应该自动为Eclipse中源目录添加。

I am trying to get working R.java generation to project in gen folder. Actually, the application builds, when using maven build, however eclipse finds error, because it can't resolve R.java file (which actually is being put in /target/generated-sources/r/R.java location after each build). What is the suggested way to solve the problem?

解决方案

The recommended way is to use the Maven Integration for Android Development Tools and the Maven Android Plugin provides instructions. From the Eclipse Integration page:

Introduction

Android's official development effort provides solid support for Eclipse integration, and we'd like to make sure maven-android-plugin helps bridge Maven, Android, and Eclipse. This page will help us collect information on what works and doesn't work

The solution

To make maven-android-plugin work well in Eclipse with ADT, this is what you need:

  1. Go to the M2Eclipse Android Integration project page and install the tools listed under Requirements.
  2. Of course, set up update-site url and install the M2Eclipse Android Integration plugin in Eclipse. * Get version 0.2.2 or later. It should be under the category 'Maven Integration for Android Development Tools'.
  3. In Eclipse, to bring in your Maven Android projects, choose File -> Import... -> Maven -> Existing Maven Projects.

So jump to the M2Eclipse Android Integration project page and then to the Getting Started guide for very detailed instructions.

With the right tooling, the directory of the generated code should be added automatically as source directory under Eclipse.

这篇关于与Android Maven的 - R.java文件生成(Eclipse中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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