我正在尝试设置jenkins来构建Android应用程序和存档构建。 但是,似乎我无法存档调试apk。 使用“干净调试”运行Ant,并选择“归档工件”。我尝试使用* / .apk和bin / test-debug.apk,这是我想要的文件(并且可以通过jenkins工作区浏览器看到。
控制台日志:
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/test-project/workspace
Checkout:workspace / /var/lib/jenkins/jobs/test-project/workspace - hudson.remoting.LocalChannel@eb3f66
Using strategy: Default
Last Built Revision: Revision bae064038961f07de92252f6f65d222e90d2d871 (origin/HEAD, origin/master)
Checkout:workspace / /var/lib/jenkins/jobs/test-project/workspace - hudson.remoting.LocalChannel@eb3f66
Fetching changes from 1 remote Git repository
Fetching upstream changes from /home/andraz/test/.git
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision bae064038961f07de92252f6f65d222e90d2d871 (origin/HEAD, origin/master)
Checking out Revision bae064038961f07de92252f6f65d222e90d2d871 (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
[workspace] $ ant -Dsdk.dir=/home/andraz/android-sdk-linux clean debug
Buildfile: /var/lib/jenkins/jobs/test-project/workspace/build.xml
-pre-clean:
clean:
[delete] Deleting directory /var/lib/jenkins/jobs/test-project/workspace/bin
[delete] Deleting directory /var/lib/jenkins/jobs/test-project/workspace/gen
-set-mode-check:
-set-debug-files:
-set-debug-mode:
-debug-obfuscation-check:
-setup:
[echo] Creating output directories if needed...
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/bin
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/bin/res
[echo] Gathering info for test...
[setup] Android SDK Tools Revision 17
[setup] Project Target: Android 2.2
[setup] API level: 8
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup] API<=15: Adding annotations.jar to the classpath.
[setup]
[setup] ------------------
[setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.
-build-setup:
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/gen
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/bin/classes
-pre-build:
-code-gen:
[echo] ----------
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 4 source files to /var/lib/jenkins/jobs/test-project/workspace/bin/classes
-post-compile:
-obfuscate:
-dex:
[dex] Converting compiled files and external libraries into /var/lib/jenkins/jobs/test-project/workspace/bin/classes.dex...
-crunch:
[crunch] Crunching PNG Files in source dir: /var/lib/jenkins/jobs/test-project/workspace/res
[crunch] To destination dir: /var/lib/jenkins/jobs/test-project/workspace/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Creating full resource package...
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating test-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /var/lib/jenkins/jobs/test-project/workspace/bin/test-debug.apk
[propertyfile] Creating new property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
[propertyfile] Updating property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
[propertyfile] Updating property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
[propertyfile] Updating property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
-post-build:
debug:
BUILD SUCCESSFUL
Total time: 4 seconds
Archiving artifacts
ERROR: No artifacts found that match the file pattern "**/*.apk". Configuration error?
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE
在我看来,文件已生成但不知何故未找到。 另外如果我选择存档bin / test *它会存储test-debug-unaligned.apk.d,test.apk_,test.apk.d但是没有apks 任何见解?
答案 0 :(得分:1)
当归档发生时,似乎文件根本就不存在。作为最后一个构建步骤运行shell脚本,执行ls -l bin
并通过检查控制台输出来查看文件是否确实存在。