Ubuntu 编译报错 ninja: build stopped: subcommand failed.

报错信息如下:

DroidDoc took 4 sec. to write docs to out/target/common/docs/apache-http-stubs-gen
[ 48% 10841/22512] Building with Jack:...http.legacy_intermediates/classes.jack
FAILED: out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack 
/bin/bash -c "(rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack ) 
&& (rm -rf out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc ) 
&& (mkdir -p out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/ ) 
&& (mkdir -p out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc ) 
&& (rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) 
&& (touch out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) 
&& (if [ -d \"out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src\" ]; 
then find out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src -name '*.java' >> 
out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list; fi ) 
&& (tr ' ' '\\n' < out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list 
| build/tools/normalize_path.py | sort -u > out/target/common/obj/JAVA_LIBRARIES/
org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq ) && 
(if [ -s out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq ] 
; then export tmpEcjArg=\"@out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/
jack-rsc/java-source-list-uniq\"; else export tmpEcjArg=\"\"; fi;  
JACK_VERSION=4.32.CANDIDATE out/host/linux-x86/bin/jack @build/core/jack-default.args -g -D jack.java.source.version=1.7 
 --classpath out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/classes.jack     
 -D jack.import.resource.policy=keep-first -D jack.import.type.policy=keep-first -D 
 jack.android.min-api-level=21  --output-jack out/target/common/obj/JAVA_LIBRARIES/
 org.apache.http.legacy_intermediates/classes.jack   \$tmpEcjArg || 
 ( rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack ; exit 41 ) ) 
 && (rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) 
 && (mv out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/
 java-source-list-uniq out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc.java-source-list )"
No Jack server running. Try 'jack-admin start-server'
[ 48% 10848/22512] target Java: framew...ARIES/framework_intermediates/classes)

ninja: build stopped: subcommand failed.
21:25:15 ninja failed with: exit status 1

#### failed to build some targets (01:02:56 (hh:mm:ss)) ####

解决方案参考网址:https://blog.csdn.net/touxiong/article/details/86233805
一般是由于服务器进程 打开文件数受限制

1.vim /etc/security/limits.conf 添加如下的行

# 解除服务器所有用户文件数 进程限制
*             soft       nofile      10240
*             hard       nofile      10240
*             soft       noproc      10240
*             hard       noproc      10240

2.保存后,再输入 ulimit -n 10240 回车即可生效。

3.提示 ulimit 命令 执行:

sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"

再执行第二个步骤即可,

4.使用 ulimit -a 可以检查查看!

你可能感兴趣的:(Ubuntu,android,系统)