Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get dependency for android-support-v7-appcompat.jar #271

Open
mhelmstetter opened this issue Jan 24, 2015 · 10 comments
Open

Can't get dependency for android-support-v7-appcompat.jar #271

mhelmstetter opened this issue Jan 24, 2015 · 10 comments

Comments

@mhelmstetter
Copy link

I've gone over the docs several times and I can't seem to figure out the correct groupId/artifactId to get this dependency to install/resolve:
extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar

Here are the relevant dependencies I've got so far

        <dependency>
            <groupId>android.support</groupId>
            <artifactId>compatibility-v4</artifactId>
            <version>21.0.3</version>
        </dependency>

        <dependency>
            <groupId>com.android.support</groupId>
            <artifactId>support-v13</artifactId>
            <version>21.0.3</version>
            <type>aar</type>
            <exclusions>
                <exclusion>
                    <artifactId>support-v4</artifactId>
                    <groupId>com.android.support</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.android.support</groupId>
            <artifactId>appcompat-v7</artifactId>
            <version>21.0.3</version>
            <type>aar</type>
            <exclusions>
                <exclusion>
                    <artifactId>support-v4</artifactId>
                    <groupId>com.android.support</groupId>
                </exclusion>
            </exclusions>
        </dependency>
@william-ferguson-au
Copy link
Contributor

What are the symptoms?

On Sun, Jan 25, 2015 at 7:31 AM, Mark Helmstetter [email protected]
wrote:

I've gone over the docs several times and I can't seem to figure out the
correct groupId/artifactId to get this dependency to install/resolve:
extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar

Here are the relevant dependencies I've got so far

    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v4</artifactId>
        <version>21.0.3</version>
    </dependency>

    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>support-v13</artifactId>
        <version>21.0.3</version>
        <type>aar</type>
        <exclusions>
            <exclusion>
                <artifactId>support-v4</artifactId>
                <groupId>com.android.support</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>appcompat-v7</artifactId>
        <version>21.0.3</version>
        <type>aar</type>
        <exclusions>
            <exclusion>
                <artifactId>support-v4</artifactId>
                <groupId>com.android.support</groupId>
            </exclusion>
        </exclusions>
    </dependency>


Reply to this email directly or view it on GitHub
#271.

@mhelmstetter
Copy link
Author

Thanks for the quick reply. Symptoms are that I can't resolve the class ActionBarActivity.

I think maybe I figured it out, it seems that adding

<dependency>
            <groupId>android.support</groupId>
            <artifactId>compatibility-v7-appcompat</artifactId>
            <version>21.0.3</version>
            <type>jar</type>
        </dependency>

gets me what I need. I'm not sure why the docs say that is deprecated.

I left the apklib dependency out, as that was causing an error

<dependency>
  <groupId>android.support</groupId>
  <artifactId>compatibility-v7-appcompat</artifactId>
  <version>21.0.3</version>
  <type>apklib</type>
</dependency>

I think I've got all of my dependencies now, but not 100% sure yet.

@pkhivesara
Copy link

@mhelmstetter can you point out how did you get the dependency to work? On mine it keeps on complaining that it cannot find the version for any of the support library i.e: v4,v13,appcompat-v7.
Looking at the folders in the /.m2 repo i see that the folders are created for each of the support library but each one of them is empty inside. I cannot seem to figure out what did i do wrong from the documentation.

@mhelmstetter
Copy link
Author

@pkhivesara First, make sure that you have downloaded all of the support/compatibility libraries via the Android SDK Manager under the "Extras" section. Then cd to "maven-android-sdk-deployer/extras" and run "mvn install".

Also, make sure that you are referencing the proper groupId. You should NOT be using the com.google.android groupId for artifacts other than "android".

@pkhivesara
Copy link

@mhelmstetter I tried what you suggested. The build fails with the error below:

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.8.0:generate-sources (default-generate-sources) on project co
mpatibility-v7-appcompat: MojoExecutionException: ANDROID-040-001: Could not exe
cute: Command = cmd.exe /X /C "C:\Users\Downloads\adt-bundle-windows-x86_64
-20130522\adt-bundle-windows-x86_64-20130522\sdk\build-tools\20.0.0\aapt.exe pac
kage --non-constant-id -m -J D:\maven-android-sdk-deployer-master\maven-android-
sdk-deployer-master\extras\compatibility-v7-appcompat\target\generated-sources\r
-M C:\Users\Downloads\adt-bundle-windows-x86_64-20130522\adt-bundle-window
s-x86_64-20130522\sdk\extras\android\support\v7\appcompat\AndroidManifest.xml --
auto-add-overlay -I C:\Users\Downloads\adt-bundle-windows-x86_64-20130522\a
dt-bundle-windows-x86_64-20130522\sdk\platforms\android-19\android.jar", Result
= 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit

Any ideas?

@mhelmstetter
Copy link
Author

Sounds like that could be this issue: #190

Try moving your Android SDK to something with shorter path, e.g. C:\android-sdk and change your ANDROID_HOME.

@pkhivesara
Copy link

Still failing with the same error.

UPDATE 1:

I managed to get past the issue causing the error only to stumble upon an different error now causing the V7-appcompat to fail again.

The error log:

[INFO] C:\Users\Downloads\adt-bundle-windows-x86_64-20130522\adt-bundle-win
dows-x86_64-20130522\sdk\extras\android\support\v7\appcompat\res\values-v21\them
es_base.xml:195: error: Error: No resource found that matches the given name: at
tr 'android:colorControlHighlight'.
[INFO]
[INFO] C:\Users\Downloads\adt-bundle-windows-x86_64-20130522\adt-bundle-win
dows-x86_64-20130522\sdk\extras\android\support\v7\appcompat\res\values-v21\them
es_base.xml:193: error: Error: No resource found that matches the given name: at
tr 'android:colorControlNormal'.
[INFO]
[INFO] C:\Users\Downloads\adt-bundle-windows-x86_64-20130522\adt-bundle-win
dows-x86_64-20130522\sdk\extras\android\support\v7\appcompat\res\values-v21\them
es_base.xml:190: error: Error: No resource found that matches the given name: at
tr 'android:colorPrimary'.
[INFO]
[INFO] C:\Users\Downloads\adt-bundle-windows-x86_64-20130522\adt-bundle-win
dows-x86_64-20130522\sdk\extras\android\support\v7\appcompat\res\values-v21\them
es_base.xml:191: error: Error: No resource found that matches the given name: at
tr 'android:colorPrimaryDark'.
[INFO]
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourc
esMojo.generateR(GenerateSourcesMojo.java:576)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourc
esMojo.execute(GenerateSourcesMojo.java:211)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
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.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001:
Could not execute: Command = cmd.exe /X /C "C:\Users\Downloads\adt-bundle-
windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sdk\build-tools\21.1.
2\aapt.exe package --non-constant-id -m -J D:\maven-android-sdk-deployer-master
extras\compatibility-v7-appcompat\target\generated-sources\r -M C:\Users\Do
wnloads\adt-bundle-windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sd
k\extras\android\support\v7\appcompat\AndroidManifest.xml -S C:\Users\Downl
oads\adt-bundle-windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sdk\e
xtras\android\support\v7\appcompat\res --auto-add-overlay -I C:\Users\Downl
oads\adt-bundle-windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sdk\p
latforms\android-19\android.jar", Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultComma
ndExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourc
esMojo.generateR(GenerateSourcesMojo.java:572)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Android Extras .................................... SUCCESS [0.741s]
[INFO] Android Compatibility Extra V4 .................... SUCCESS [0.656s]
[INFO] Android Compatibility Extra V7 Gridlayout Library . SUCCESS [3.543s]
[INFO] Android Compatibility Extra V7 AppCompat Library .. FAILURE [1.086s]
[INFO] Android Compatibility Extra V7 Mediarouter Library SKIPPED
[INFO] Android Compatibility Extra V13 ................... SKIPPED
[INFO] Android Google Analytics Extra .................... SKIPPED
[INFO] Android Google AdMob Ads Extra .................... SKIPPED
[INFO] Android Google Cloud Messaging Library Extra Parent SKIPPED
[INFO] Android Google Cloud Messaging Client Library Extra SKIPPED
[INFO] Android Google Cloud Messaging Server Library Extra SKIPPED
[INFO] Android Google Play Services Extra ................ SKIPPED
[INFO] Android Google Play Licensing Extra ............... SKIPPED
[INFO] Android Extras - Apk Expansion .................... SKIPPED
[INFO] Android Google Play APK Expansion Extra - ZIP ..... SKIPPED
[INFO] Android Google Play APK Expansion Extra - Downloader SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.924s
[INFO] Finished at: Fri Jan 30 14:07:33 EST 2015
[INFO] Final Memory: 29M/301M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.8.0:generate-sources (default-generate-sources) on project co
mpatibility-v7-appcompat: MojoExecutionException: ANDROID-040-001: Could not exe
cute: Command = cmd.exe /X /C "C:\Users\Downloads\adt-bundle-windows-x86_64
-20130522\adt-bundle-windows-x86_64-20130522\sdk\build-tools\21.1.2\aapt.exe pac
kage --non-constant-id -m -J D:\maven-android-sdk-deployer-master\extras\compati
bility-v7-appcompat\target\generated-sources\r -M C:\Users\Downloads\adt-bu
ndle-windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sdk\extras\andro
id\support\v7\appcompat\AndroidManifest.xml -S C:\Users\Downloads\adt-bundl
e-windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sdk\extras\android
support\v7\appcompat\res --auto-add-overlay -I C:\Users\Downloads\adt-bundl
e-windows-x86_64-20130522\adt-bundle-windows-x86_64-20130522\sdk\platforms\andro
id-19\android.jar", Result = 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.

UPDATE 2:

The above error was caused because the pom.xml in the sdk-deployer folder is hard-coded to use API level 19. Is there a reason the pom doesn't use the latest-greatest SDK version?

@Nilzor
Copy link

Nilzor commented Apr 30, 2015

Any update on this? I'm confused as hell on how to use the appcompat libs after running this installer. First I had to modify pom.xml for this repo to run modules extras and repositories for it to install the support libs at all when running with argument -P 5.0 (It failed when running without any arguments because it was looking for API v8 files- which I have not and will not install) . Anyway when I finally made the installer run, this is what I see:

  1. The installer copies the support libraries to folder m2\repository\android\support\compatibility-v7-appcompat\22.1.1` No it does not. I have no idea how those files got there
  2. The installer does not copy to .m2\repository\com\android\support, which means I cannot use the groupid com.android.support as documented in README.md

This is how my the two dependencies for appcompat v7 looks in my pom.xml now and I believe it works.

        <dependency>
            <groupId>android.support</groupId>
            <artifactId>compatibility-v7-appcompat</artifactId>
            <version>22.1.1</version>
            <type>apklib</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>android.support</groupId>
            <artifactId>compatibility-v7-appcompat</artifactId>
            <version>22.1.1</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

Is README.md outdated?

@mosabua
Copy link
Member

mosabua commented May 31, 2016

The whole compatiblity extras seems to be gone from the SDK.. not sure what to do about this now.

@spyhunter99
Copy link

I too am looking for android.support:compatibility-v4:jar:[23,)

sigh... thanks google

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants