2

我正在使用新的Android ADT Bundle和Android-Mavem部署程序設置新的Android-Maven開發。Android-Maven安裝時未能執行目標org.codehaus.mojoto

$ANDROID_HOME/Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk

當我在maven-android-sdk-deployer-master文件夾跑mvn clean install -X,我得到了這些錯誤:

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.966s 
[INFO] Finished at: Sat Oct 12 20:34:27 PDT 2013 
[INFO] Final Memory: 11M/81M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project android-3: Properties file not found: /Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk/platforms/android-3/source.properties -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :android-3 

這裏有一些額外的錯誤消息:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project android-3: Properties file not found: /Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk/platforms/android-3/source.properties 

它看起來很對我來說很陌生,因爲我甚至沒有android-3文件夾:

ALLAN-MacBook-Pro:platforms allanhahaha$ pwd 
/Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk/platforms 
ALLAN-MacBook-Pro:platforms allanhahaha$ ls -l 
total 0 
drwxr-xr-x 11 allanhahaha staff 374 Oct 12 18:15 android-10 
drwxr-xr-x 12 allanhahaha staff 408 Oct 12 18:14 android-11 
drwxr-xr-x 12 allanhahaha staff 408 Oct 12 18:13 android-12 
drwxr-xr-x 12 allanhahaha staff 408 Oct 12 18:12 android-13 
drwxr-xr-x 10 allanhahaha staff 340 Oct 12 18:10 android-14 
drwxr-xr-x 10 allanhahaha staff 340 Oct 12 18:10 android-15 
drwxr-xr-x 11 allanhahaha staff 374 Oct 12 18:10 android-16 
drwxr-xr-x 11 allanhahaha staff 374 Oct 12 18:09 android-17 
[email protected] 11 allanhahaha staff 374 Sep 10 11:56 android-18 
drwxr-xr-x 11 allanhahaha staff 374 Oct 12 18:16 android-8 

這裏是我的pom.xml配置的一部分:

<build> 
<pluginManagement> 
    <plugins> 
    <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>properties-maven-plugin</artifactId> 
     <version>1.0-alpha-2</version> 
    </plugin> 
    <plugin> 
     <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
     <artifactId>android-maven-plugin</artifactId> 
     <version>3.6.0</version> 
     <configuration> 
     <sdk> 
      <platform>${android.sdk.platform}</platform> 
     </sdk> 
     </configuration> 
    </plugin> 
    </plugins> 
</pluginManagement> 
<extensions> 
    <extension> 
    <groupId>org.apache.maven.wagon</groupId> 
    <artifactId>wagon-webdav-jackrabbit</artifactId> 
    <version>2.4</version> 
    </extension> 
</extensions> 

我是新來的Maven的所以沒有關於正在發生的事情與此錯誤消息的想法。請幫忙看看。謝謝。

回答

1

我仍然不知道爲什麼會發生這種情況,但似乎打開Android SDK Manager並重新安裝包含該錯誤的軟件包可能有所幫助(在我的情況下,安裝Android 1.5(API 3)包括SDK平臺和Google API),然後再次運行mvn安裝程序。

+0

爲什麼這個答案被投票?對我來說似乎是正確的答案。 Android Maven部署者README建議了這個確切的解決方法。 – bogdan

1

ANDROID_HOME必須指向您的Android SDK而不是ADT。

E.g.我使用

export $ANDROID_HOME=/opt/tools/android-sdk-mac_86 
相關問題