gpt4 book ai didi

android - Maven with Android - R.java 文件生成 (Eclipse)

转载 作者:可可西里 更新时间:2023-11-01 18:46:53 25 4
gpt4 key购买 nike

我正在尝试将工作的 R.java 生成生成到 gen 文件夹中。实际上,应用程序在使用 maven 构建时构建,但是 eclipse 发现错误,因为它无法解析 R.java 文件(实际上在每次构建后将其放入/target/generated-sources/r/R.java 位置) .解决问题的建议方法是什么?

最佳答案

推荐的方法是使用Maven Integration for Android Development Tools,Maven Android Plugin 提供了说明。来自Eclipse Integration页:

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.

所以跳转到M2Eclipse Android Integration project page然后到 Getting Started指南以获得非常详细的说明。

使用正确的工具,生成代码的目录应该自动添加为 Eclipse 下的源目录。

关于android - Maven with Android - R.java 文件生成 (Eclipse),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3360648/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com