-
Type:
Bug
-
Resolution: Not A Defect
-
Priority:
Major
-
Component/s: android-signing-plugin
-
Environment:Jenkins 2.69/Android Signing Plugin 2.2.5 running on Kubernetes 1.6. The actual build machine is Debian Jesse within a Docker container running as a Jenkins slave.
Signing APKs in a Jenkins Pipeline fails with following message:
Â
[Test_Sign_APK] Running shell script + ls -l /opt/android-sdk/build-tools/26.0.1/zipalign -rwxr-xr-x. 1 android android 131217 Aug 9 15:53 /opt/android-sdk/build-tools/26.0.1/zipalign [Pipeline] signAndroidApks Executing shell script inside container [imeet-android-sdk] of pod [jenkins-slave-jdq6t-l2nht] Executing command: "echo" ""resolving effective environment"" printf "EXITCODE %3d" $?; exit # cd "/home/jenkins/workspace/Test_Sign_APK" "echo" ""resolving effective environment"" printf "EXITCODE %3d" $?; exit # resolving effective environment # EXITCODE 0[SignApksBuilder] zipalign path explicitly set to /opt/android-sdk/build-tools/26.0.1/zipalign [SignApksBuilder] no zipalign or zipalign.exe found in path /opt/android-sdk/build-tools/26.0.1 [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // container [Pipeline] } [Pipeline] // node [Pipeline] } [Pipeline] // podTemplate [Pipeline] End of Pipeline ERROR: failed to find zipalign path in parameters or environment Finished: FAILURE
Â
Note in the second line that I the pipeline (code below) runs 'ls -l' on the full path of zipalign and it returns successfully with the correct file and permissions.
The relevant Pipeline code snipped for brevity:
Â
env.ANDROID_HOME = '/opt/android-sdk'
env.ANDROID_ZIPALIGN = '/opt/android-sdk/build-tools/26.0.1/zipalign'
<snip>
stage ('Sign APK') {
sh "ls -l ${ANDROID_ZIPALIGN}"
signAndroidApks (
keyStoreId: "AndroidSigningKeystore",
keyAlias: "AndroidSigningKeystore",
apksToSign: "**/*.apk",
// uncomment the following line to output the signed APK to a separate directory as described above
// signedApkMapping: [ $class: UnsignedApkBuilderDirMapping ]
// uncomment the following line to output the signed APK as a sibling of the unsigned APK, as described above, or just omit signedApkMapping
// you can override these within the script if necessary
// androidHome: env.ANDROID_HOME
zipalignPath: env.ANDROID_ZIPALIGN
)
}
Â
Â
Â