Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6364953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:13:55+00:00 2026-05-25T00:13:55+00:00

I am trying to build my Android project with Maven so I could automate

  • 0

I am trying to build my Android project with Maven so I could automate my tests, but I’m getting the following error:

D:\Projects\mtproject>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AppScience 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-android-plugin:2.8.4:generate-sources (default-generate-sources) @ appsci
ence ---
[INFO] ANDROID-904-002: Found aidl files: Count = 3
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Copying local resource files to combined resource directory.
[INFO] C:\Program Files (x86)\Android\android-sdk/platform-tools/aapt.exe [package, -m, -J
, D:\Projects\mtproject\target\generated-sources\r, -M, D:\Projects\mtproject\AndroidManif
est.xml, -S, D:\Projects\mtproject\target\generated-sources\combined-resources\res, -A, D:
\Projects\mtproject\assets, -I, C:\Program Files (x86)\Android\android-sdk\platforms\andro
id-4\android.jar]
[INFO] D:\Projects\mtproject\target\generated-sources\combined-resources\res\layout\main.x
ml:2: error: Error: String types not allowed (at 'layout_height' with value 'match_parent'
).
[INFO] D:\Projects\mtproject\target\generated-sources\combined-resources\res\layout\main.x
ml:2: error: Error: String types not allowed (at 'layout_width' with value 'match_parent')
.
[INFO] D:\Projects\mtproject\target\generated-sources\combined-resources\res\layout\main.x
ml:5: error: Error: String types not allowed (at 'layout_width' with value 'match_parent')
.
[INFO] D:\Projects\mtproject\target\generated-sources\combined-resources\res\layout\main.x
ml:11: error: Error: String types not allowed (at 'layout_width' with value 'match_parent'
).
[INFO] D:\Projects\mtproject\target\generated-sources\combined-resources\res\layout\splash
.xml:2: error: Error: String types not allowed (at 'layout_width' with value 'match_parent
').
[INFO] D:\Projects\mtproject\target\generated-sources\combined-resources\res\layout\splash
.xml:2: error: Error: String types not allowed (at 'layout_height' with value 'match_paren
t').
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.gen
erateR(GenerateSourcesMojo.java:313)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.exe
cute(GenerateSourcesMojo.java:111)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPlugi
nManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

        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.buildProject(Lifecyc
leModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Lifecyc
leModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(Lifecy
cleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.j
ava:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
va:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:
290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.jav
a:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not
 execute: Command = cmd.exe /X /C ""C:\Program Files (x86)\Android\android-sdk\platform-to
ols\aapt.exe" package -m -J D:\Projects\mtproject\target\generated-sources\r -M D:\Project
s\mtproject\AndroidManifest.xml -S D:\Projects\mtproject\target\generated-sources\combined
-resources\res -A D:\Projects\mtproject\assets -I "C:\Program Files (x86)\Android\android-
sdk\platforms\android-4\android.jar"", Result = 1
        at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(Comma
ndExecutor.java:186)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.gen
erateR(GenerateSourcesMojo.java:311)
        ... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.558s
[INFO] Finished at: Fri Aug 26 04:00:16 CEST 2011
[INFO] Final Memory: 7M/45M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:maven-android-
plugin:2.8.4:generate-sources (default-generate-sources) on project appscience: MojoExecut
ionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C ""C:\Program Fil
es (x86)\Android\android-sdk\platform-tools\aapt.exe" package -m -J D:\Projects\mtproject\
target\generated-sources\r -M D:\Projects\mtproject\AndroidManifest.xml -S D:\Projects\mtp
roject\target\generated-sources\combined-resources\res -A D:\Projects\mtproject\assets -I
"C:\Program Files (x86)\Android\android-sdk\platforms\android-4\android.jar"", Result = 1
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the foll
owing articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I can’t figure out what the error is!

Thanks a lot everybody in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:13:55+00:00Added an answer on May 25, 2026 at 12:13 am

    OK I got it: it was a configuration problem with the pom.xml:

    <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            ...................
            <configuration>
                <sdk>
                    <platform>17</platform>
                </sdk>
           </configuration>
     ............
    

    Just make sure you choose the right SDK version there.
    The value match_parent is not valid value for earlier versions than Android SDK 1.6 (I was having a <platform>4</platform>).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the moment I'm trying to build some integration tests for an android project.
I'm trying to build an Android project using the ndk, but I have run
Trying to build my android project with Buildr (Apache), but can't find any info
I'm newbie in maven and trying to configure it to build my android project
I am trying to build my android project using ant in command line mode.
I am trying to build my Android project with Ant. Whenever I use Eclipse
Hi I'm trying to use the maven android plugin and robolectric to get tests
I am trying to build and run an android project using the phonegap framework.
I'm trying to build an android application. It was working fine, but when I
I've got a Android AppEngine Connected Project I'm trying to build using GWT2.4 RequestFactory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.