I want to start using the new ActionBar
of the appcompat-v7
support library, and I'm using maven. I tried to create an apklib. These are the steps I followed:
android-sdks/extras/android/support/v7/appcompat
C:....m2\repository\android\support\compatibility-v7-appcompat\18>mvn install:install-file -Dfile=appcombat.apklib -DgroupId=android.support -DartifactId=appcompat -Dversion=18 -Dpackaging=apklib
Start using the library from my android project adding this dependency in the pom:
<dependency>
<groupId>android.support</groupId>
<artifactId>appcompat</artifactId>
<version>18</version>
<type>apklib</type>
</dependency>
But it's not working. I'm getting an error of missing artifact.
Any help would be much appreciated.
Android AppCompat Library V7 The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.
In the Properties window, select the "Android" properties group at left and locate the Library properties at right. Select /path/to/appcompat/ and Click Remove. Click Add to open the Project Selection dialog. From the list of available library projects, select v7 appcompat library and click OK.
When new versions of android are published, Google will have to support the older versions of android. So AppCompat is a set of support libraries which can be used to make the apps developed with newer versions work with older versions.
The is a way to install appcompat into your local repository without relying on Maven SDK deployer...
From the Android SDK Manager, install the 'Android Support Repository' option. go into your SDK folder, then into ./extras/m2Repository/com/android/support/appcompat-v7/18.0.0
open the appcompat-v7-18.0.0.aar file and copy the classes.jar out to a file named appcompat-v7-18.0.0.jar
at the command line go into the same m2Repository folder and run the following commands:
mvn install:install-file -Dfile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.jar"/ -DpomFile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.pom"/ -Dpackaging="jar"
mvn install:install-file -Dfile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.aar"/ -DpomFile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.pom"/ -Dpackaging="apklib"
Then add the following two dependencies in your project's POM
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>18.0.0</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>18.0.0</version>
<type>jar</type>
</dependency>
The apklib generated with maven-android-sdk-deployer works fine for me.
https://github.com/mosabua/maven-android-sdk-deployer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With