Ubuntu系统编译Android平台,source和lunch命令执行正常,编译时log显示:
/bin/sh: 1: source: not found
/bin/sh: 1: lunch: not found
/bin/sh: 1: get_build_var: not found
/bin/sh: 1: unexpected operator
等异常
解决方法:
shell脚本命令开启POSIX模式,将bin/sh由dash切换为bash
$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Sep 7 10:02 /bin/sh -> dash
执行sudo dpkg-reconfigure dash 将dash切换为bash

切换后问题解决。
在Ubuntu系统中编译Android平台时遇到source、lunch等命令执行失败的问题,错误原因是/bin/sh指向了dash而不是bash。解决方法是通过运行`sudo dpkg-reconfigure dash`命令,将/bin/sh从dash切换到bash,从而修复编译过程中的脚本执行异常。


被折叠的 条评论
为什么被折叠?



