简体   繁体   English

Jenkins的Cordova Android构建失败

[英]Jenkins fails Cordova Android build

I have been struggling with getting this to work from Jenkins for weeks and I know it's got to be something simple. 数周以来,我一直在努力让詹金斯(Jenkins)做到这一点,我知道这一定很简单。

I am able to log onto the build machine via Remote Desktop and do the build just fine running 我能够通过远程桌面登录到构建机器,并进行良好的构建

npm run build:android

which in turn calls 依次调用

webpack && cordova build android --verbose.

This is the same command I'm using from Jenkins. 这是我从Jenkins使用的相同命令。 My Jenkins build step is to run the following Windows Batch Commands: 我的Jenkins构建步骤是运行以下Windows Batch命令:

call npm install
call npm run build:android

The error 错误

This is the error that I get when it is run from Jenkins: 这是从詹金斯运行时遇到的错误:

17:30:26 ANDROID_HOME=C:\Users\build\AppData\Local\Android\sdk
17:30:26 JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
17:30:26 Running command: cmd "/s /c ""C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat" -p C:\Jenkins\workspace\gm-mobile-android-build\platforms\android wrapper -b C:\Jenkins\workspace\gm-mobile-android-build\platforms\android\wrapper.gradle""
17:30:26 Command finished with error code ENOENT: cmd /s /c ""C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat" -p C:\Jenkins\workspace\gm-mobile-android-build\platforms\android wrapper -b C:\Jenkins\workspace\gm-mobile-android-build\platforms\android\wrapper.gradle"
17:30:26 Error: cmd: Command failed with exit code ENOENT

Unfortunately I haven't been able to figure out much from this error message. 不幸的是,我无法从此错误消息中找出很多东西。 I presumed it could have something to do with permission but I can run the same command fine with the same user via Remote Desktop. 我以为它可能与权限有关,但是我可以通过远程桌面以相同的用户身份运行相同的命令。

Any guidance is much appreciated. 任何指导是非常感谢。

Needed to add C:\\Windows\\System32 to the PATH variable specified for this machine in Jenkins. 需要将C:\\ Windows \\ System32添加到Jenkins中为此计算机指定的PATH变量中。

Found the answer here: https://stackoverflow.com/a/33280304/2449330 在这里找到答案: https : //stackoverflow.com/a/33280304/2449330

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM