4

I use maven-android-plugin to build my android app which depends on android support library v4 and v7.
Since I didn't find how to download the whole sdk from developer.android.com, I cnnot use maven android deployee tool to set local repository of android sdk.Thus I want to use the support library that includes in the adt-bundle, below is how I write the dependencies in my pom.xml:

        <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v7</artifactId>
        <version>18</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/appcompat/libs/android-support-v7-appcompat.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v4</artifactId>
        <version>18</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/appcompat/libs/android-support-v4.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility</artifactId>
        <version>18</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/appcompat.apklib</systemPath>
        <type>apklib</type>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility</artifactId>
        <version>18</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/appcompat/bin/appcompat.jar</systemPath>
    </dependency>

The first two is what I wrote at beginning, but maven raised an error:

No resource found that matches the given name 'Theme.AppCompat.Light'.

Then I added third one. I zip the v7 project and rename to .apklib.But it still does not work.
At last I add the last one,but it does not work either.So how to write a correct pom to fix this? My system infomation:

Apache Maven 3.0.4
Java version: 1.7.0_25, vendor: Oracle Corporation
Android Platform Version:4.3
Android Maven Plugin:3.6.0
cgcgbcbc
  • 539
  • 4
  • 20

2 Answers2

0

When I was playing with this I added a <type>jar</type> and a <type>apklib</type>. I don't remember all the details.

  • I did this: https://stackoverflow.com/a/18796764/1738827
  • My pom file had this:

    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>appcompat-v7</artifactId>
        <version>18.0.0</version>
        <type>apklib</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>appcompat-v7</artifactId>
        <version>18.0.0</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    
Community
  • 1
  • 1
Miklos Jakab
  • 2,024
  • 1
  • 23
  • 31
0

Try this:

 <dependency>
     <groupId>com.android.support</groupId>
     <artifactId>appcompat-v7</artifactId>
     <version>18.0.0</version>
     <type>aar</type>
 </dependency>

I used this and Theme.Appcompat.Light is visible.

Janin
  • 292
  • 1
  • 2
  • 7