Reputation: 5605
I am building my android app with Maven (ok... trying to build), after several errors I got to this one :
[ERROR] Failed to execute goal on project AndroidPro: Could not resolve dependencies for project com.kowalsk.android.recipe:AndroidPro:apk:1.0.0-SNAPSHOT: Could not find artifact com.google.android:android:jar:4.0.3 in central (http://repo.maven.apache.org/maven2) -> [Help 1]
I used maven-android-sdk-deployer and downloaded all needed libraries, but it haven't solved the problem.
Upvotes: 1
Views: 888
Reputation: 28706
When using maven-android-sdk-deployer : the stub for android libraries will be installed in your local maven repo with the groupId android
(i.e. not com.google.android
)
The groupId com.google.android
is the official groupId used by google to publish some versions of android API. I don't know why only few versions are available (probably because maven wasn't the build tool choose by google for the android platform). We can hope that in a near future (mainly because google choose gradle as new build tool): all versions will be available with the groupId com.google.android in central repo.
In my local repo, the stubs installed with maven-android-sdk-deployer have also a special version number with _rX
appended. So to use the 4.0.3 I have the following dependency :
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.0.3_r3</version>
<scope>provided</scope>
</dependency>
Upvotes: 2
Reputation: 11487
See the link Maven Android Jar, maven repository does not have the version you mentioned in your pom 4.0.3
use any version mentioned in the link.
Upvotes: 2