【问题标题】:Jenkins build with ant does not produce a apk fileJenkins 用 ant 构建不会生成 apk 文件
【发布时间】:2014-12-09 19:30:55
【问题描述】:

jenkins 新手并尝试使用 ant 构建构建

我有以下项目结构。

-workspace 
 -- project-A
 -- project-B (Lib project used by project-A)

我运行了我在 jenkins 网站上找到的以下命令 https://wiki.jenkins-ci.org/display/JENKINS/Building+an+Android+app+and+test+project

android update project -p project-A

android update lib-project --target "Google Inc.:Google APIs:18" --path project-B

它创建 build.xml 文件和属性文件。

我正在使用 git。因此,请确保一切都已签入。

当我尝试构建项目时,我得到了成功的结果,但没有输出 APK 文件。我检查了我是否有“归档工件”的“构建后操作”。

这是 jenkins 的构建输出

Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/jobs/Test.Android/workspace
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://git@git.kiwadigital.com/************* # timeout=10
Fetching upstream changes from ssh://git@git.kiwadigital.com/*************
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git fetch --tags --progress ssh://git@git.************/************* +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision a5bcdc51c07300aa18244049bcf80b1282ff55d6 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f a5bcdc51c07300aa18244049bcf80b1282ff55d6
 > git rev-list a5bcdc51c07300aa18244049bcf80b1282ff55d6 # timeout=10
[workspace] $ /Users/Shared/Jenkins/Home/tools/hudson.tasks.Ant_AntInstallation/Apache_Ant/bin/ant -file Project-A
Buildfile: /Users/Shared/Jenkins/Home/jobs/Test.Android/workspace/Project-A/build.xml

help:
     [echo] Android Ant Build. Available targets:
     [echo]    help:      Displays this help.
     [echo]    clean:     Removes output files created by other targets.
     [echo]               This calls the same target on all dependent projects.
     [echo]               Use 'ant nodeps clean' to only clean the local project
     [echo]    debug:     Builds the application and signs it with a debug key.
     [echo]               The 'nodeps' target can be used to only build the
     [echo]               current project and ignore the libraries using:
     [echo]               'ant nodeps debug'
     [echo]    release:   Builds the application. The generated apk file must be
     [echo]               signed before it is published.
     [echo]               The 'nodeps' target can be used to only build the
     [echo]               current project and ignore the libraries using:
     [echo]               'ant nodeps release'
     [echo]    instrument:Builds an instrumented package and signs it with a
     [echo]               debug key.
     [echo]    test:      Runs the tests. Project must be a test project and
     [echo]               must have been built. Typical usage would be:
     [echo]                   ant [emma] debug install test
     [echo]    emma:      Transiently enables code coverage for subsequent
     [echo]               targets.
     [echo]    install:   Installs the newly build package. Must either be used
     [echo]               in conjunction with a build target (debug/release/
     [echo]               instrument) or with the proper suffix indicating
     [echo]               which package to install (see below).
     [echo]               If the application was previously installed, the
     [echo]               application is reinstalled if the signature matches.
     [echo]    installd:  Installs (only) the debug package.
     [echo]    installr:  Installs (only) the release package.
     [echo]    installi:  Installs (only) the instrumented package.
     [echo]    installt:  Installs (only) the test and tested packages (unless
     [echo]               nodeps is used as well.
     [echo]    uninstall: Uninstalls the application from a running emulator or
     [echo]               device. Also uninstall tested package if applicable
     [echo]               unless 'nodeps' is used as well.

BUILD SUCCESSFUL
Total time: 0 seconds
Archiving artifacts
Finished: SUCCESS

在 jenkins 中,我不检查我的 bin 文件夹。这会导致任何问题吗?

任何帮助将不胜感激。提前致谢

【问题讨论】:

    标签: android ant jenkins


    【解决方案1】:

    您是否添加了名为存档工件的构建后操作?

    【讨论】:

      【解决方案2】:

      问题与构建本身有关。出于某种原因,即使没有任何建设,它也取得了成功。我必须更改更多设置才能使其正常工作。同样在配置页面中必须在 Build -> Invoke Ant -> Targets 下指定调试或发布

      库项目中还缺少 build.xml 文件。因此,一旦我创建了所有 build.xml 文件并添加了目标,它似乎正在创建 apk 文件并且现在可以下载它。

      感谢您的帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-12-10
        • 2010-11-30
        • 2013-07-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-13
        • 1970-01-01
        相关资源
        最近更新 更多