2011-08-26 10 views
7

Estoy tratando de construir mi proyecto Android con Maven para que pudiera automatizar mis pruebas, pero estoy consiguiendo el error siguiente:error con Maven

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 

no puedo averiguar cuál es el el error es!

¡Muchas gracias a todos de antemano!

Respuesta

10

Aceptar lo tengo: que era un problema de configuración con el pom.xml:

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

sólo asegúrese de elegir la versión correcta SDK allí. El valor match_parent no es válido para versiones anteriores a Android SDK 1.6 (tenía un <platform>4</platform>).

Cuestiones relacionadas