0

I am new to maven and I am trying to setup android project using maven.

I have the path environments set up for java, maven and android sdk.

For some reason I am getting a build failure in Maven SDK deployer when trying to do a mvn clean install or mvn clean and then mvn install.

Now, the setup process stops at API 2.2 and all the other steps are skipped.

Now, when I do a mvn clean, I get list of the following:

Reactor Summary:

Maven Android SDK Deployer ......................... SUCCESS [  0.062 s]
Android Platforms .................................. SUCCESS [  0.003 s]
Android Platform 1.5 API 3 ......................... SUCCESS [  0.002 s]
Android Platform 1.6 API 4 ......................... SUCCESS [  0.008 s]
Android Platform 2.1 API 7 ......................... SUCCESS [  0.004 s]
Android Platform 2.2 API 8 ......................... SUCCESS [  0.002 s]
Android Platform 2.3.3 API 10 ...................... SUCCESS [  0.006 s]
Android Platform 3.0 API 11 ........................ SUCCESS [  0.003 s]
Android Platform 3.1 API 12 ........................ SUCCESS [  0.003 s]
Android Platform 3.2 API 13 ........................ SUCCESS [  0.003 s]
Android Platform 4.0 API 14 ........................ SUCCESS [  0.006 s]
Android Platform 4.0.3 API 15 ...................... SUCCESS [  0.006 s]
Android Platform 4.1 API 16 ........................ SUCCESS [  0.003 s]
Android Platform 4.2 API 17 ........................ SUCCESS [  0.008 s]
Android Platform 4.3 API 18 ........................ SUCCESS [  0.002 s]
Android Platform 4.4 API 19 ........................ SUCCESS [  0.003 s]
Android Platform 4.4W API 20 ....................... SUCCESS [  0.004 s]
Android Platform 5.0 API 21 ........................ SUCCESS [  0.002 s]
Android Add-Ons .................................... SUCCESS [  0.003 s]
Android Add-On Google Platform 1.5 API 3 (Maps) .... SUCCESS [  0.012 s]
Android Add-On Google Platform 1.6 API 4 (Maps) .... SUCCESS [  0.003 s]
Android Add-On Google Platform 2.1 API 7 (Maps) .... SUCCESS [  0.006 s]
Android Add-On Google Platform 2.2 API 8 (Maps) .... SUCCESS [  0.002 s]
Android Add-On Google Platform 2.3.3 API 10 (Maps and USB) SUCCESS [  0.003 s]
Android Add-On Google Platform 3.0 API 11 (Maps) ... SUCCESS [  0.003 s]
Android Add-On Google Platform 3.1 API 12 (Maps and USB) SUCCESS [  0.011 s]
Android Add-On Google Platform 3.2 API 13 (Maps and USB) SUCCESS [  0.003 s]
Android Add-On Google Platform 4.0 API 14 (Maps and USB) SUCCESS [  0.003 s]
Android Add-On Google Platform 4.0.3 API 15 (Maps and USB) SUCCESS [  0.008 s]
Android Add-On Google Platform 4.1 API 16 (Maps and USB) SUCCESS [  0.001 s]
Android Add-On Google Platform 4.2 API 17 (Maps and USB) SUCCESS [  0.002 s]
Android Add-On Google Platform 4.3 API 18 (Maps and USB) SUCCESS [  0.003 s]
Android Add-On Google Platform 4.4 API 19 (Maps and USB) SUCCESS [  0.010 s]
Android Add-On Google Platform 5.0 API 21 (Maps and USB) SUCCESS [  0.002 s]
Google Glass Development Kit (GDK) API 19 .......... SUCCESS [  0.003 s]
Android Extras ..................................... SUCCESS [  0.003 s]
Android Compatibility Extra V4 ..................... SUCCESS [  0.002 s]
Android Compatibility Extra V7 Gridlayout Library .. SUCCESS [  0.022 s]
Android Compatibility Extra V7 AppCompat Library ... SUCCESS [  0.003 s]
Android Compatibility Extra V7 Mediarouter Library . SUCCESS [  0.002 s]
Android Compatibility Extra V13 .................... SUCCESS [  0.002 s]
Android Google Play Services Extra ................. SUCCESS [  0.001 s]
Android Google Play Services Extra for Froyo ....... SUCCESS [  0.000 s]
Android Google Play Licensing Extra ................ SUCCESS [  0.002 s]
Android Extras - Apk Expansion ..................... SUCCESS [  0.001 s]
Android Google Play APK Expansion Extra - ZIP ...... SUCCESS [  0.001 s]
Android Google Play APK Expansion Extra - Downloader SUCCESS [  0.001 s]
Android MultiDex ................................... SUCCESS [  0.001 s]
Repositories ....................................... SUCCESS [  0.001 s]
Google M2Repository ................................ SUCCESS [  0.000 s]
Android M2Repository ............................... SUCCESS [  0.001 s]
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1.867 s
Finished at: 2015-02-02T11:42:53-05:00
Final Memory: 16M/45M
------------------------------------------------------------------------

And then I try mvn install and I get this :

[INFO] Reactor Summary:
[INFO]
[INFO] Maven Android SDK Deployer ......................... SUCCESS [  0.255 s]
[INFO] Android Platforms .................................. SUCCESS [  0.008 s]
[INFO] Android Platform 1.5 API 3 ......................... SUCCESS [  0.166 s]
[INFO] Android Platform 1.6 API 4 ......................... FAILURE [  0.003 s]
[INFO] Android Platform 2.1 API 7 ......................... SKIPPED
[INFO] Android Platform 2.2 API 8 ......................... SKIPPED

All the files after Android Platform 1.6 API 4 are skipped and so I have to manually install the other platforms by using mvn install -p verno.

To debug this process, I used `mvn install -e' and got the following error log :

[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project android-4: Propertie
s file not found: G:\Android SDK\adt-bundle-windows-x86_64-20140702\sdk\platforms\android-4\source.properties -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-prop
erties (default) on project android-4: Properties file not found: G:\Android SDK\adt-bundle-windows-x86_64-20140702\sdk\platforms\android-4\source.pro
perties
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Properties file not found: G:\Android SDK\adt-bundle-windows-x86_64-20140702\sdk\platforms\
android-4\source.properties
        at org.codehaus.mojo.properties.ReadPropertiesMojo.execute(ReadPropertiesMojo.java:110)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more

Not sure why I am getting this error. I also have the pom.xml setup to build a new project but I can't proceed with that unless the Maven Android Deployer is setup correctly.

I want to import the project in intellij and so I am trying to learn maven. I am aware that we can export an existing project using eclipse plugin but I want to know the working of a maven project from the intellij IDE.

Is there something I am doing wrong here or if there's any alternate steps to follow to build android project using maven, please let me know and i'll really appreciate it.

mike20132013
  • 5,357
  • 3
  • 31
  • 41

1 Answers1

1

The error states that you do not have API 4 installed. Install the API 4 via the SDK Manager and then try mvn clean install. In case you want only a specific SDK to install, use the following command:

mvn install -P API_VERSION (Substitute the API_VERSION with the SDK version you want. eg: 4,21.)

user2511882
  • 9,022
  • 10
  • 51
  • 59