gpt4 book ai didi

android - 如何使用 Jenkins 构建android项目?

转载 作者:行者123 更新时间:2023-12-03 06:31:41 25 4
gpt4 key购买 nike

我一直在尝试设置 Jenkins 来构建基于gradle的android项目。

到目前为止,这是我所做的:

  • 使用Bitnami的Jenkins Stack启动EC2实例。
  • 成功测试了每分钟打印“正常运行时间”的作业。
  • 已安装Android SDK工具。

  • 但是现在,当我配置一个作业来用它构建android项目时,我得到了一个奇怪的异常,我认为这与我的ubuntu机器上的某些权限有关。

    这是堆栈跟踪:
        First time build. Skipping changelog.
    [workspace] $ /bin/sh -xe /opt/bitnami/apache-tomcat/temp/hudson1533897385497543877.sh
    + whoami
    tomcat
    + echo Starting Build
    Starting Build
    [Gradle] - Launching build.
    [workspace] $ gradle clean
    Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
    java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.util.logging.LogManager$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(Unknown Source)
    at org.gradle.logging.internal.JavaUtilLoggingConfigurer.configure(JavaUtilLoggingConfigurer.java:36)
    at org.gradle.logging.internal.DefaultLoggingConfigurer.configure(DefaultLoggingConfigurer.java:34)
    at org.gradle.logging.internal.LoggingSystemAdapter.setLevel(LoggingSystemAdapter.java:55)
    at org.gradle.logging.internal.LoggingSystemAdapter.on(LoggingSystemAdapter.java:42)
    at org.gradle.logging.internal.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:191)
    at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:60)
    at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:31)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)

    FAILURE: Build failed with an exception.

    * What went wrong:
    Failed to create parent directory '/opt/bitnami/.gradle/caches/2.6/scripts' when creating directory '/opt/bitnami/.gradle/caches/2.6/scripts/settings_i62l96mhihwg5udfskdyy53h/cp_settings'

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 2.27 secs
    Build step 'Invoke Gradle script' changed build result to FAILURE
    Build step 'Invoke Gradle script' marked build as failure
    Finished: FAILURE

    准备提供任何其他人需要的其他信息。请建议我该怎么办。

    最佳答案

    我与 Jenkins 合作已有很长时间了,这可能有很多原因。首先,我要检查 Jenkins 的环境变量。添加一个构建setp echo $ PATH,因为在我看来这就像java找不到某些库。将此PATH变量与本地变量进行比较。另外,在安装新东西之后,请确保执行http:// {your_jenkins_url} / restart。

    关于android - 如何使用 Jenkins 构建android项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32596792/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com