APK: No resource found that matches the given name

274 views
Skip to first unread message

Pawel

unread,
Nov 3, 2017, 8:33:46 PM11/3/17
to Maven Android Developers

Dear Maven Android Developers

I want to migrate my projects from Android Studio to build them using maven and I have a problem with building APK. The error message is:

[INFO] Generating R file for android2:cast:apk:0.0.1-SNAPSHOT
[INFO] C:\Users\Pawel\workspace\android2\cast\src\main\res\values\styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[INFO]
[INFO] C:\Users\Pawel\workspace\android2\cast\src\main\res\values\styles.xml:8: error: Error: No resource found that matches the given name: attr 'colorAccent'.
[INFO]
[INFO] C:\Users\Pawel\workspace\android2\cast\src\main\res\values\styles.xml:6: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
[INFO]
[INFO] C:\Users\Pawel\workspace\android2\cast\src\main\res\values\styles.xml:7: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
[INFO]
[ERROR] Error when generating sources.

 
I suppose that "appcompat" dependice is missing, but how I can migrate below line from gradle to maven

compile 'com.android.support:appcompat-v7:25.3.1'

I had added to the POM.xml
<dependency>
        <groupId>com.android.support</groupId>
        <artifactId>appcompat-v7</artifactId>
        <version>25.3.1</version>
</dependency>


but got the error:

[ERROR] Failed to execute goal on project cast: Could not resolve dependencies for project android2:cast:apk:0.0.1-SNAPSHOT: Failure to find com.android.support:appcompat-v7:jar:25.3.1 in https://repo.maven.apache.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]

Attached my POM.xml

What am I missing?
Thanks in advance for help.

Regards,
Pawel

pom.xml

William Ferguson

unread,
Nov 4, 2017, 11:30:12 PM11/4/17
to Maven Android Developers
com.android.support:appcompat-v7 is an aar dependency, but you haven't declared what type of dependency you require, so by default Maven uses jar.

Change your dependency config to:

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

William
Reply all
Reply to author
Forward
0 new messages