At the end of a maven mvn clean install run, the created artifacts are automatically installed in the repository by the maven-install-plugin:
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # project ---
[INFO] Installing C:\Users\mannaz\workspace\project\target\project-0.1.1-test.apk to C:\Users\mannaz\.m2\repository\at\mannaz\android\project\0.1.1\project-0.1.1.apk
[INFO] Installing C:\Users\mannaz\workspace\project\pom.xml to C:\Users\mannaz\.m2\repository\at\mannaz\android\project\0.1.1\project-0.1.1.pom
[INFO] Installing C:\Users\mannaz\workspace\project\target\project-0.1.1-test.jar to C:\Users\mannaz\.m2\repository\at\mannaz\android\project\0.1.1\project-0.1.1.jar
Unfortunately the final apk filename is renamed during this process (project-0.1.1-test.apk>>project-0.1.1.apk).
Initially the name of the apk file is set via
<finalName>${project.artifactId}-${project.version}-${webservice.target}</finalName>
How can I specify the final name of the apk file in the build archive without overriding the <version/> attribute itself?
Reason:
Running mvn clean install -X cause Maven execute default-install goal at the end of the build life cycle, which use the default groupId:artifactId:packaging:version install the generated apk (I use abc-123 as the final name in this example):
[INFO] --- maven-install-plugin:2.1:install (default-install) # myapp ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader#11b86e7]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.1:install' with basic configurator -->
[DEBUG] (f) artifact = com.mycompany:myapp:apk:1.2.2-SNAPSHOT
[DEBUG] (f) attachedArtifacts = [com.mycompany:myapp:jar:1.2.2-SNAPSHOT]
[DEBUG] ... ...
[DEBUG] -- end configuration --
[INFO] Installing C:\workspace\myapp\target\abc-123.apk to c:\maven\repository\com\mycompany\myapp\1.2.2-SNAPSHOT\myapp-1.2.2-SNAPSHOT.apk
[INFO] ... ...
Solution:
This default artifact install is AFAIK neither avoidable nor modifiable, and the <finalName> doesn't take any effect on the target file name (which use a fixed pattern artifactId-version-classifier.packaging) during the default-install goal execution. The solution is attach extra artifact to the build life cycle, depend on you demand (If you only need add some suffix behind myapp-1.2.2-SNAPSHOT), the easiest way is define a classifier in android-maven-plugin configuration:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<classifier>test</classifier>
... ...
</configuration>
</plugin>
This will cause both myapp-1.2.2-SNAPSHOT.apk and myapp-1.2.2-SNAPSHOT-test.apk get installed into maven repository:
[INFO] --- maven-install-plugin:2.1:install (default-install) # myapp ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader#11b86e7]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.1:install' with basic configurator -->
[DEBUG] (f) artifact = com.mycompany:myapp:apk:1.2.2-SNAPSHOT
[DEBUG] (f) attachedArtifacts = [com.mycompany:myapp:jar:1.2.2-SNAPSHOT, com.mycompany:myapp:apk:test:1.2.2-SNAPSHOT]
[DEBUG] ... ...
[DEBUG] -- end configuration --
[INFO] Installing C:\workspace\myapp\target\abc-123.jar to c:\maven\repository\com\mycompany\myapp\1.2.2-SNAPSHOT\myapp-1.2.2-SNAPSHOT.apk
[INFO] ... ...
[INFO] Installing C:\workspace\myapp\target\abc-123.apk to c:\maven\repository\com\mycompany\myapp\1.2.2-SNAPSHOT\myapp-1.2.2-SNAPSHOT-test.apk
Related
I downloaded zxing and tried to build it locally with mvn.
I got some problem, when I try to build android project (to make it a jar other than apk file), I got this error:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------ ------
[INFO] Building Android Barcode Scanner app 4.7.1
[INFO] ------------------------------------------------------------------ ------
[WARNING] The POM for com.google.zxing:core:jar:3.1.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.zxing:android-core:jar:3.1.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.352 s
[INFO] Finished at: 2015-01-27T13:32:25+00:00
[INFO] Final Memory: 10M/36M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project android: Could not resolve dependencies for project com.google.zxing:android:jar:4.7.1: The following artifacts could not be resolved: com.google.zxing:core:jar:3.1.1-SNAPSHOT, com.google.zxing:android-core:jar:3.1.1-SNAPSHOT: Failure to find com.google.zxing:core:jar:3.1.1-SNAPSHOT in https://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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]
I put android-core-3.1.1-SNAPSHOT.JAR AND core-3.1.1-SNAPSHOT.JAR into the libs folder of android project, but it doesn't help at all.
what I am doing wrong? The pom file under android folder is
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>android-core</artifactId>
<version>3.1.1-SNAPSHOT</version>
<packaging>jar</packaging>(i changed from apk to jar as I want to build it as a jar other than apk)
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
</dependency>
</dependencies>
<parent>
<groupId>com.google.zxing</groupId>
<artifactId>zxing-parent</artifactId>
<version>3.1.1-SNAPSHOT</version>
</parent>
<name>ZXing Android Core</name>
<description>Code common to Android applications</description>
</project>
This is just a Maven question. You have downloaded source code for master, so points to SNAPSHOT builds. If you really want to use that, you need to mvn install to create snapshot artifacts locally. Here you just went straight to android/ and built it, but that won't work. Just build everything from the top level and it will work.
This is described at https://github.com/zxing/zxing/wiki/Getting-Started-Developing except that if you are building snapshots off master you need to mvn install not mvn package.
I've tried to create an MQTT project on Android by using PAHO.
According to the description, I clone the source code to my computer, and using
mvn clean install
to build the project.
I download org.eclipse.paho.mqtt.java-1.0.0, and expecting to get:
org.eclipse.paho.client.mqttv3-1.0.0.jar and
org.eclipse.paho.android.service-1.0.0.jar
but after running mvn clean install, I just can get org.eclipse.paho.client.mqttv3-1.0.0.jar, so I can't build the project.
and here is the message output:
C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.and roid.service>mvn install -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model fororg.eclipse.paho:android-service:jar:0.1
[WARNING] 'version' contains an expression but should be a constant. # org.eclipse.paho:java-parent:${paho.version}, C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\pom.xml, line 7, column 11
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # line 95, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building android-service 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- templating-maven-plugin:1.0-alpha-3:filter-sources (filter-src) # android-service ---
[INFO] Request to add 'C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\src\main\java-templates' folder. Not added since it does not exist.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # android-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) # android-service ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (generate-manifest) # android-service ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.910 s
[INFO] Finished at: 2015-01-15T13:16:59+08:00
[INFO] Final Memory: 13M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:manifest (generate-manifest) on project android-service: Cannot find C:\Users\Janniin\
Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must be run after compile phase) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:manifest (generate-manifest) on projec
t android-service: Cannot find C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must b
e run after compile phase)
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: Cannot find C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must be run after compile phase)
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:73)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:264)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.FileNotFoundException: C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes
at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer(ManifestPlugin.java:175)
at org.apache.felix.bundleplugin.ManifestPlugin.getManifest(ManifestPlugin.java:114)
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:69)
... 23 more
[ERROR]
[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
Could anyone give me some suggest to solve this problem??
Thx a lot!!
Have you tried following the information described here https://eclipse.org/paho/clients/java/ in order to build from source.
After running mvn package -DskipTests (it took some time) I got:
org.eclipse.paho.android.service-1.0.1.jar which is located under ..\org.eclipse.paho.mqtt.java\org.eclipse.paho.android.service\org.eclipse.paho.android.service\target
org.eclipse.paho.client.mqttv3-1.0.1.jar which is located under ..\org.eclipse.paho.mqtt.java\org.eclipse.paho.client.mqttv3\target
I have an android project written in Scala and java using sbt 0.12.4. When I try to load it by sbt, I get an error:
$ sbt
[info] Loading project definition from /Users/alex/Documents/projects/android/test2/my_project/project
[error] java.lang.NumberFormatException: For input string: "android-4"
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
I searched for the string android-4 but didn't find anything similar to it at all. And no other clues either.
How do I find out where the error is? Or rather, how do I debug it?
last doesn't help:
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? last
[info] Loading project definition from /Users/alex/Documents/projects/android/test2/my_project/project
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set()
[debug] Copy resource mappings:
[debug]
java.lang.NumberFormatException: For input string: "android-4"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:231)
at scala.collection.immutable.StringOps.toInt(StringOps.scala:31)
at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2$$anonfun$2.apply(AndroidPath.scala:22)
at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2$$anonfun$2.apply(AndroidPath.scala:22)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
at scala.collection.mutable.ArrayOps.map(ArrayOps.scala:38)
at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2.apply(AndroidPath.scala:22)
at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2.apply(AndroidPath.scala:18)
at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:52)
at scala.collection.IndexedSeqOptimized$class.reduceLeft(IndexedSeqOptimized.scala:69)
at scala.collection.mutable.ArrayOps.reduceLeft(ArrayOps.scala:38)
at sbtandroid.AndroidPath$.sbtandroid$AndroidPath$$determineBuildToolsVersion(AndroidPath.scala:18)
at sbtandroid.AndroidPath$$anonfun$settings$5.apply(AndroidPath.scala:40)
at sbtandroid.AndroidPath$$anonfun$settings$5.apply(AndroidPath.scala:40)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$single$1.apply(INode.scala:159)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$single$1.apply(INode.scala:159)
at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:177)
at sbt.EvaluateSettings$INode.evaluate(INode.scala:132)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:64)
at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:73)
at sbt.EvaluateSettings$$anon$3.run(INode.scala:69)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
[error] java.lang.NumberFormatException: For input string: "android-4"
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
UPDATE:
The stack trace you get when you use last mentions AndroidPath.scala:22 so I'd check the source of tha. The message of the exception says that the string android-4 is not a number, so something in the android sbt plugin you are using thinks that a string containing that should contain only digits.
Search through your build config (and maybe project directories) after the string android-4 and replace it with something that is a number and see if that helps.
If that does not help: Look at the sources of the android plugin at the specified line to see what it is doing and you may figure it out (I couldn't as I don't know what plugin and version of it you are using). You could also start sbt in debug mode and add a breakpoint in the AndroidPath sources.
i was trying to follow this tutorial:
http://www.gdgankara.org/2012/11/01/step-by-step-android-development-with-maven/
but after setting up the environment, and create a project, at the "run as\maven install" step i got this:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tutorial 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- android-maven-plugin:3.1.1:generate-sources (default-generate-sources) # tutorial ---
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.889s
[INFO] Finished at: Sat May 18 00:32:12 CEST 2013
[INFO] Final Memory: 8M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project tutorial: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [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/PluginExecutionException
I've tried lot of times, but with no luck.
I have Eclipse Juno on Windows7 64 bit, APK Tool installed and Maven 3.0.5.
It seems a well known problem for maven staff:
https://code.google.com/p/maven-android-plugin/issues/detail?id=104
but it should be solved from ages...
My Environment User variables:
M2_HOME=C:\Program Files\Java\apache-maven-3.0.5
ANDROID_HOME=C:\adt-bundle-windows-x86_64-20130514\sdk
My Environment System variable:
Path=......;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\build-tools;%ANDROID_HOME%\platforms;%M2_HOME%\bin;%ANDROID_HOME%\build-tools\android-4.2.2
Does anybody know how to workout this trap?
thanks!
I also encountered the same problem when using latest ADT from google and trying to compile the bootstrap android platform.
The latest r17 build separate out aapt to build-tools folder. Hence it is maven-android-plugin cannot support it.
See issue discussed here.
Tried and working:
cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/android-4.2.2/aapt aapt
ln -s ../build-tools/android-4.2.2/lib lib
ln -s ../build-tools/android-4.2.2/aidl aidl
Some installations may be structured using the API version:
cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/17.0.0/aapt aapt
ln -s ../build-tools/17.0.0/lib lib
ln -s ../build-tools/17.0.0/aidl aidl
Keep in mind that this is fixed in the latest version (>3.5.3) of the Android Maven Plugin, as other answers point out.
Update:
This has been resolved since Android Maven Plugin v3.6.0. For now you will only need these symlinks if you use IntelliJ v12.x. IntelliJ v13 EAP+ should work out of the box.
Original answer:
This has been fixed and will be released with Android Maven Plugin v3.5.4. See the github pull request:
Upgraded AndroidSdk to use path and platform utilities from sdklib
You can try validating the snapshot build which contains the fix by adding the following to your pom.xml:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.4-SNAPSHOT</version>
...
</plugin>
...
<pluginRepositories>
<pluginRepository>
<id>oss.sonatype.org-jayway-snapshots</id>
<name>Jayway OpenSource SNAPSHOTs on Sonatype.org</name>
<url>http://oss.sonatype.org/content/repositories/jayway-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Please provide feedback on the developer group:
New snapshot for 3.5.4 available
If you are using Windows, the symbolic linking can be done using mklink command.
D:\>cd "Program Files (x86)\Android\android-sdk"
D:\Program Files (x86)\Android\android-sdk>cd platform-tools
D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink aapt.exe ..\build-tools\17.0.0\aapt.exe
symbolic link created for aapt.exe <<===>> ..\build-tools\17.0.0\aapt.exe
D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink aidl.exe ..\build-tools\17.0.0\aidl.exe
symbolic link created for aidl.exe <<===>> ..\build-tools\17.0.0\aidl.exe
D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink /d lib ..\build-tools\17.0.0\lib
symbolic link created for lib <<===>> ..\build-tools\17.0.0\lib
I get stuck with the same problem. Finally i managed to resolve the issue after two hours. To make it simple and resolve the issue in 5 minutes i listed the steps below
Step 1 - In Eclipse update your Android Maven Plugin to 0.4.3.2013 using the beta release link
http://rgladwell.github.io/m2e-android/updates/master/
Step 2
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
</configuration>
</plugin>
It will solve the following issues
"No Android Platform Version/API Level has been configured"
Could not find tool 'aapt'
Hope it helps
I too had similar problems.
Solved by following steps :
1) Upgrade maven to 3.1.1
2) Use android-maven-plugin 3.6.1 pr greater [I used 3.8.0]
3) Use maven-dependency-plugin 2.8
If you want to build against latest Android SDK [ex : 4.3], follow following additional steps -
4) Install the local copy of android.jar using command mvn install:installFile ..
5) Set 18
Hope this helps.
I'm using macOS 10.14 and in my case:
I download Android packaging tool from AAPT and then copied all the files into $ANDROID_HOME/platforms/$SDK/tools/
DON'T REMIND CHANGE $SDK WITH YOUR REAL NAME SDK FOR INSTANCE android-29
I am new to this maven concept, I am building one android application for which I am want to robospice lib. Rebospice demo example need maven clean install. I installed maven on my ubuntu 12.04
mvn -v
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_10, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-35-generic-pae", arch: "i386", family: "unix"
Then I tried maven clean install on my demo project it gives following error
[WARNING] The POM for com.octo.android.robospice:robospice:jar:1.3.2-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.351s
[INFO] Finished at: Mon Jan 21 15:15:55 IST 2013
[INFO] Final Memory: 10M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project robospice-sample-core: Could not resolve dependencies for project com.octo.android.robospice:robospice-sample-core:apk:1.0.0-SNAPSHOT: Could not find artifact com.octo.android.robospice:robospice:jar:1.3.2-SNAPSHOT -> [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/DependencyResolutionException.
Whats the problem behind this.. Need help to solve this problem....
You probably have to configure your maven repositories (You tell maven where to get the dependencies)
OR
Something went wrong the first time you tried to download the artefact.
If this is the later, you can solve the problem by browsing your ".m2" folder and go and see if the corresponding folder contains just metadata files or if it contains the jar and the pom as well. I something looks wrong, you can just delete the folder and retry to build your project.
By the way, it seems that this project "robospice" has a more recent version available (and stable, not snapshot), so you might want to try to use 1.3.1 instead of 1.0.0 SHAPSHOT, if it fits with your project needs.