Droid-Fu构建错误

时间:2011-02-17 01:19:27

标签: android maven droid-fu

我正在尝试按照GitHub页面上的指定构建Droid-Fu,但构建失败了。这是我在Droid-Fu文件夹中运行 mvn package 后得到的消息

[INFO] artifact junit:junit: checking for updates from central
Downloading: http://powermock.googlecode.com/svn/repo//com/google/android/maps/maps/9_r1/maps-9_r1.jar
[INFO] Unable to find resource 'com.google.android.maps:maps:jar:9_r1' in repository powermock-repo (http://powermock.googlecode.com/svn/repo/)
Downloading: http://repo1.maven.org/maven2/com/google/android/maps/maps/9_r1/maps-9_r1.jar
[INFO] Unable to find resource 'com.google.android.maps:maps:jar:9_r1' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.google.android.maps:maps:jar:9_r1

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.google.android.maps -DartifactId=maps -Dversion=9_r1 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.google.android.maps -DartifactId=maps -Dversion=9_r1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) com.github.droidfu:droid-fu:jar:1.0-SNAPSHOT
    2) com.google.android.maps:maps:jar:9_r1

----------
1 required artifact is missing.

for artifact: 
  com.github.droidfu:droid-fu:jar:1.0-SNAPSHOT

知道我可能做错了吗?

5 个答案:

答案 0 :(得分:5)

我遇到了同样的问题。较新版本的Android SDK略微改变了目录。您必须将maven指向Google Maps jar版本9的正确路径。

在以下命令中将 path-to-android-sdk 替换为基本目录

mvn install:install-file -DgroupId = com.google.android.maps -DartifactId = maps -Dversion = 9_r1 -Dpackaging = jar -Dfile = path-to-android-sdk / add -ONs / addon_google_apis_google_inc_9 /库/ maps.jar

然后你想执行以下命令来构建droid-fu jar: mvn包

希望这有帮助!

答案 1 :(得分:3)

Maps JAR不在Maven Central上,因为它包含专有代码。您可以使用maven-android-sdk-deployer从本地SDK安装中轻松安装它。

要确保您拥有所有平台版本,请先运行

android update sdk --no-ui

然后git clone SDK部署者并运行

mvn install

如果您只想安装一个特定平台版本,请使用-P <version>标志运行。

答案 2 :(得分:0)

该错误表示Google地图API缺失。您需要先安装它。你必须通过Android UI安装它。我相信它是其中一个附加组件。

http://code.google.com/android/add-ons/google-apis/installing.html

答案 3 :(得分:0)

我有类似的问题编译droid-fu和谷歌搜索解决方案。在我的案例帮助启动

android update sdk

命令没有 --no-ui选项。然后我看到一些Google插件根本没有安装。所以安装它们,问题就消失了。

答案 4 :(得分:0)

我使用了maven-android-sdk-deployer“来直接从你当地Android SDK installation安装使用Maven和Android Maven插件构建Android应用程序所需的库

(以zip格式下载,解压缩到临时文件夹,运行“mvn install”[必须设置EnvVars])

在此之后,android项目的maven构建成功运行,但我使用了Maps API 8_r2:

<dependency>
    <groupId>com.google.android.maps</groupId>
    <artifactId>maps</artifactId>
    <version>8_r2</version>
    <scope>provided</scope>
</dependency>