我试图让一个Android应用程序构建在Jenkins上但是它失败了一个模糊的错误消息。应用程序在我的机器上使用Maven构建得很好,但它并不适用于Jenkins。我四处寻找解决方案,并说它更新了我做的android SDK,但它没有解决问题。这是完整的堆栈跟踪。
注意:我将Google Play服务和Facebook SDK项目称为依赖项。
mavenExecutionResult exceptions not empty message : Failed to execute goal
com.jayway.maven.plugins.android.generation2:机器人-行家-插件:3.6.0:DEX 项目lv2-geosafe上的(default-dex):原因:堆栈跟踪: org.apache.maven.lifecycle.LifecycleExecutionException:失败 执行目标 com.jayway.maven.plugins.android.generation2:Android的Maven的插件:3.6.0:DEX 项目lv2-geosafe上的(default-dex):at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)at at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在java.lang.reflect.Method.invoke(Method.java:597)at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) 在 org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) 在 org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) 在hudson.maven.Maven3Builder.call(Maven3Builder.java:98)at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)at hudson.remoting.UserRequest.perform(UserRequest.java:118)at hudson.remoting.UserRequest.perform(UserRequest.java:48)at hudson.remoting.Request $ 2.run(Request.java:326)at hudson.remoting.InterceptingExecutorService $ 1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask $ Sync.innerRun(FutureTask.java:303) 在java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor中的$ Worker.runTask(ThreadPoolExecutor.java:886) 在 java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:908) 在java.lang.Thread.run(Thread.java:662)引起: org.apache.maven.plugin.MojoExecutionException:at com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.runDex(DexMojo.java:382) 在 com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.execute(DexMojo.java:145) 在 org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 27更多引起: com.jayway.maven.plugins.android.ExecutionException:ANDROID-040-001: 无法执行:Command = / bin / sh -c cd /root/.hudson/jobs/lv2/workspace/lv2-geosafe& amp ;& amp; /usr/local/jdk1.6.0_23/jre/bin/java -Xmx1024M -jar /usr/local/android-sdk/platform-tools/lib/dx.jar --dex --output = /根/ .hudson /作业/ LV2 /工作区/ LV2-geosafe /目标/ classes.dex /root/.m2/repository/com/google/code/gson/gson/2.2.2/gson-2.2.2.jar /root/.m2/repository/com/unboundid/unboundid-ldapsdk/2.3.3/unboundid-ldapsdk-2.3.3.jar /root/.m2/repository/com/terrapages/mapapi/mapapi/1.0.0/mapapi-1.0.0.jar /root/.m2/repository/com/google/android/gms/google-play-services/2.3.0/google-play-services-2.3.0.jar /root/.hudson/jobs/lv2/workspace/lv2-util/target/lv2-util.jar /root/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar /root/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar /root/.hudson/jobs/lv2/workspace/lv2-model/target/lv2-model.jar /root/.m2/repository/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final.jar /root/.m2/repository/com/terrapages/ims /model/1.0.7/model-1.0.7.jar /root/.m2/repository/org/hibernate/hibernate-annotations/3.5.6-Final/hibernate-annotations-3.5.6-Final.jar /root/.m2/repository/com/github/avianey/facebook-android-api/3.0.1/facebook-android-api-3.0.1.jar /root/.m2/repository/ch/acra/acra/4.4.0/acra-4.4.0.jar /root/.m2/repository/com/github/avianey/facebook-android-api/3.0.1/facebook-android-api-3.0.1.apklib /root/.hudson/jobs/lv2/workspace/lv2-api/target/lv2-api-1.0.2-SNAPSHOT.jar /root/.m2/repository/com/terrapages/ims/util/1.0.7/util-1.0.7.jar /root/.hudson/jobs/lv2/workspace/lv2-geosafe/target/classes /root/.m2/repository/com/google/android/gms/google-play-services/2.3.0/google-play-services-2.3.0.apklib /root/.m2/repository/com/terrapages/ims/api/1.0.7/api-1.0.7.jar, 结果= 1 at com.jayway.maven.plugins.android.CommandExecutor $厂$ DefaultCommandExecutor.executeCommand(CommandExecutor.java:246) 在 com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.runDex(DexMojo.java:378) ... 30多个频道停止完成:失败
答案 0 :(得分:0)
好了,深入了解你的堆栈跟踪,你会看到这一行:
引起:com.jayway.maven.plugins.android.ExecutionException:ANDROID-040-001:无法执行:Command = / bin / sh -c cd /root/.hudson/jobs/lv2/workspace/lv2 -geosafe&& /usr/local/jdk1.6.0_23/jre/bin/java -Xmx1024M -jar /usr/local/android-sdk/platform-tools/lib/dx.jar --dex --output = / root / .hudson / jobs / lv2 / workspace / lv2-geosafe / target / classes.dex ...大量的罐子......,结果= 1
如果您在终端中执行所述命令(包括我在上面遗漏的jar文件但不包括“,Result = 1”的列表),您可能会收到有关此命令失败原因的更多信息。也许你没有在/ usr / local / android-sdk上安装Android SDK?