3

我尝试将我的项目移动到 cloudbees CI。

android SDK 由 cloudbees 提供。它位于路径 /opt/android/android-sdk-linux

但不幸的是,我使用 maven-android-plugin 3.6.0 得到了以下堆栈跟踪:

message : Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources (default-generate-sources) on project wizardpager: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: Invalid SDK: Platform/API level 16 not available. This command should give you all you need:
/opt/android/android-sdk-linux/tools/android update sdk --no-ui --obsolete --force
cause : Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: Invalid SDK: Platform/API level 16 not available. This command should give you all you need:
/opt/android/android-sdk-linux/tools/android update sdk --no-ui --obsolete --force
Stack trace : 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources (default-generate-sources) on project wizardpager: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: Invalid SDK: Platform/API level 16 not available. This command should give you all you need:
/opt/android/android-sdk-linux/tools/android update sdk --no-ui --obsolete --force
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    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(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    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:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
    at 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:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: Invalid SDK: Platform/API level 16 not available. This command should give you all you need:
/opt/android/android-sdk-linux/tools/android update sdk --no-ui --obsolete --force
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 27 more
Caused by: com.jayway.maven.plugins.android.InvalidSdkException: Invalid SDK: Platform/API level 16 not available. This command should give you all you need:
/opt/android/android-sdk-linux/tools/android update sdk --no-ui --obsolete --force
    at com.jayway.maven.plugins.android.AndroidSdk.invalidSdkException(AndroidSdk.java:100)
    at com.jayway.maven.plugins.android.AndroidSdk.<init>(AndroidSdk.java:78)
    at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1150)
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:461)
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:195)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 28 more
channel stopped
Finished: FAILURE

似乎平台/API 级别 16 不可用,但事实并非如此。我检查了。

我也使用了命令行中的参数,但是: clean install -Pstandard -X -Dandroid.sdk.path=/opt/android/android-sdk-linux -Dandroid.sdk.platform=16

任何建议将不胜感激。

4

2 回答 2

1

最近修好了。Cloudbees 将 SDK 更新到 22,现在一切正常。

R22 已发布。您还应该将 android jenkins 插件升级到 2.10。

于 2013-06-07T04:10:56.317 回答
1

你跑了吗:

/opt/android/android-sdk-linux/tools/android update sdk --no-ui --obsolete --force --filter platform-tool,tool,android-16

Android SDK 22 有不同的文件夹结构,maven-android-plugin 3.6.0 反映了这一变化(https://code.google.com/p/maven-android-plugin/wiki/Changelog)。

更新 Android SDK 工具并再次更新 a​​ndroid 平台对我有用。

于 2013-06-04T15:57:01.533 回答