当我尝试使用jenkins生成apk时,它给出了如下错误。 为什么显示没有找到apk。
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\ReadyBDev
> C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url https://github.com/ordextech/ReadyB.git # timeout=10
Fetching upstream changes from https://github.com/ordextech/ReadyB.git
> C:\Program Files (x86)\Git\bin\git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
> C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress https://github.com/ordextech/ReadyB.git +refs/heads/*:refs/remotes/origin/*
> C:\Program Files (x86)\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
> C:\Program Files (x86)\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 55c44710113c9cfb541e86bbc9e42d4b626d1dc9 (refs/remotes/origin/master)
> C:\Program Files (x86)\Git\bin\git.exe config core.sparsecheckout # timeout=10
> C:\Program Files (x86)\Git\bin\git.exe checkout -f 55c44710113c9cfb541e86bbc9e42d4b626d1dc9
Commit message: "Commit For Gradle Test"
> C:\Program Files (x86)\Git\bin\git.exe rev-list --no-walk 55c44710113c9cfb541e86bbc9e42d4b626d1dc9 # timeout=10
[ReadyBDjavascript:auth.signin($('#more-openid-options%20a.yahoo'));ev] $ cmd.exe /C "echo '"""resolving effective environment"""' && exit %%ERRORLEVEL%%"
ERROR: No APKs in workspace matching app/build/outputs/apk/app-debug.apk
[android-lint] Skipping publisher since build result is FAILURE
Archiving artifacts
Finished: FAILURE
答案 0 :(得分:1)
在最新的gradle版本中,4.x + .apks的输出路径已更改为也按释放配置分开,因此您必须检查.apk在本地构建文件夹中的位置,它可能类似于
app/build/outputs/apk/{flavor}/{debug|release}/app-{flavor}-{debug|release}.apk
然后相应地调整Jenkins配置。