[置顶] jenkins 构建 Android应用时出现类似“The SDK directory '/root/android-sdk-linux' does not exist.”的解决方案
2017-11-27 12:12
2486 查看
最近在尝试Android+jenkins+github+linux服务器版集成环境搭建。在按照教程一步步配置后,在打包的地方出现了这个问题:
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > The SDK directory '/root/android-sdk-linux' does not exist. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at https://help.gradle.org[/code]
构建由于SDK路径的问题失败了。但是我在linux上检查了一下路径,发现路径在我的环境里的确是/root/android-sdk-linux。经过Google,我发现问题出在权限上。我的SDK目录处于Root的根目录,通常情况下,unix权限不允许其他用户(指jenkins)进入这个目录。我们可以把我们的SDK目录切换到其他位置(非根目录)。
例如我执行了移动文件夹的命令:mv root/android-sdk-linux opt/
把android-sdk-linux文件夹移动到了opt/路径。同样的,这个时候不要忘了修改环境变量:
先执行:vim /etc/profile
然后修改相应行:export ANDROID_HOME="/opt/android-sdk-linux"
最后保存文件退出后执行:source /etc/profile
这个时候我们在构建一次,发现这次错误消失了,构建成功了。BUILD SUCCESSFUL in 3m 19s 146 actionable tasks: 140 executed, 6 up-to-date Build step 'Invoke Gradle script' changed build result to SUCCESS Archiving artifacts Email was triggered for: Always Sending email for trigger: Always Finished: SUCCESS
在jenkins部署过程中还是出现了几个坑,但是过程中也让我学到了很多新东西~
https://groups.google.com/forum/#!topic/jenkinsci-users/zr_pqCPfVL4
相关文章推荐
- Jenkins构建时’Users/Mac/Library/Android/sdk’ does not exist问题
- Error:The SDK directory 'D:\Program Files\Android\android-studio\sdk' does not exist.
- Error:The SDK directory 'C:\Users\Darko\AppData\Local\Android\sdk' does not exist. Please fix the 's
- The SDK directory 'XXXXXX' does not exist
- The SDK directory 'D:\SDK' does not exist
- MySQL编译安装的CMake Error: The source directory "/root/mysql-5.6.10/-with-ssl" does not exist.
- The patch E:\android-sdk-windows does not belong to a directory.Android studio will use this Andriod
- Android编译出现The file does not exist for the external tool
- [置顶] ionic2 打包android包时报'C:\Users\Administrator\AppData\Local\Android\sdk' does not exist.
- android里出现"resource directory /xxx/res does not exist"问题的解决办法
- 打开项目sdk路径不对解决办法The SDK directory 'D:\home\SDK' does not exist.
- 复制Android Studio 工程到其它电脑后遇到The SDK directory 'XXXX‘ does not exist.问题的解决方法
- CMake Error: The source directory "/root/mysql-5.5.29-linux2.6-x86_64" does not appear to contain CM
- 在为应用集成微博第三方登录获取用户信息的时候出现异常com.weibo.sdk.android.WeiboException: {"error":"User does not exists!","er
- gradle build The SDK directory does not exist
- Eclipse中使用Ant打Android包报错解决方案 – Perhaps JAVA_HOME does not point to the JDK
- Import directory '*****/EXP1' does not exist(linux+sap)
- git 解决Xcode中使用Git时出现This file does not exist at the requested revision.
- android中,使用ant多渠道打包时出现Perhaps JAVA_HOME does not point to the JDK问题的解决方法
- android studio 安装启动出现 The environment variable Java_home does not point to JVm。。