mac os 编译android源码坑点

mac os 编译android源码坑点,第1张

mac os 编译android源码坑点

1)Case-insensitive filesystems not supported

mac os 当前的文件系统不区分大小导致的

解决

在我的1000元移动硬盘

创建一个区分大小写的dmg
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 200g android.dmg
直接将它挂在上
hdiutil attach android.dmg -mountpoint /Volumes/android 
不用了卸载
hdiutil detach /Volumes/android

2)internal error: Could not find a supported mac sdk: ["10.10" "10.11" "10.12" "10.13" "10.14"]

按照网上的方法去弄没几把吊用自己看源码,发现

执行的是xcrun 去查,网上现学现卖查了个go的打印,添加一行打印 如下,直接放到shell也找不到,应该还是找不到

解决:

 xcrun  --show-sdk-version 去对版本,目录那傻逼不知道为啥是错的

11.1 不行,最后改成10.15的版本弄好了

不清楚啥原因,重新拔了下我的移动硬盘,重新挂载就好了

 添加得到的版本就好了

3)too many open files

执行ulimit -S -n 1024

4)

external/iptables/include/linux/netfilter_ipv4/ipt_ECN.h:13:10: fatal error: 'linux/netfilter/xt_DSCP.h' file not found
#include 
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

修改这个文件

//#include 
#include 
改成小写的

5)

[ 40% 13789/33676] build out/target/product/flame/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests
FAILED: out/target/product/flame/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests
/bin/bash -c "(out/host/darwin-x86/bin/sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib 		 -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts  -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts  -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy ) && (touch out/target/product/flame/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests )"
/bin/bash: line 1:  6886 Segmentation fault: 11  ( out/host/darwin-x86/bin/sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy )
[ 40% 13790/33676] build out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/treble_sepolicy_tests_27.0
FAILED: out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/treble_sepolicy_tests_27.0
/bin/bash -c "(out/host/darwin-x86/bin/treble_sepolicy_tests -l 		out/host/darwin-x86/lib64/libsepolwrap.dylib  -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts  -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts  -f out/target/product/flame/obj/ETC/product_file_contexts_intermediates/product_file_contexts 		-b out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/27.0_mapping.combined.cil 		-o out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/built_27.0_plat_sepolicy -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy 	-u out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil ) && (touch out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/treble_sepolicy_tests_27.0 )"
/bin/bash: line 1:  6897 Segmentation fault: 11  ( out/host/darwin-x86/bin/treble_sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -f out/target/product/flame/obj/ETC/product_file_contexts_intermediates/product_file_contexts -b out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/27.0_mapping.combined.cil -o out/target/product/flame/obj/ETC/treble_sepolicy_tests_27.0_intermediates/built_27.0_plat_sepolicy -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy -u out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil )
[ 40% 13791/33676] build out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/treble_sepolicy_tests_28.0
FAILED: out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/treble_sepolicy_tests_28.0
/bin/bash -c "(out/host/darwin-x86/bin/treble_sepolicy_tests -l 		out/host/darwin-x86/lib64/libsepolwrap.dylib  -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts  -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts  -f out/target/product/flame/obj/ETC/product_file_contexts_intermediates/product_file_contexts 		-b out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/28.0_mapping.combined.cil 		-o out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/built_28.0_plat_sepolicy -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy 	-u out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil ) && (touch out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/treble_sepolicy_tests_28.0 )"
/bin/bash: line 1:  6901 Segmentation fault: 11  ( out/host/darwin-x86/bin/treble_sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -f out/target/product/flame/obj/ETC/product_file_contexts_intermediates/product_file_contexts -b out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/28.0_mapping.combined.cil -o out/target/product/flame/obj/ETC/treble_sepolicy_tests_28.0_intermediates/built_28.0_plat_sepolicy -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy -u out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil )
[ 40% 13792/33676] build out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/treble_sepolicy_tests_26.0
FAILED: out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/treble_sepolicy_tests_26.0
/bin/bash -c "(out/host/darwin-x86/bin/treble_sepolicy_tests -l 		out/host/darwin-x86/lib64/libsepolwrap.dylib  -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts  -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts  -f out/target/product/flame/obj/ETC/product_file_contexts_intermediates/product_file_contexts 		-b out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/26.0_mapping.combined.cil 		-o out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/built_26.0_plat_sepolicy -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy 	-u out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil ) && (touch out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/treble_sepolicy_tests_26.0 )"
/bin/bash: line 1:  6888 Segmentation fault: 11  ( out/host/darwin-x86/bin/treble_sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib -f out/target/product/flame/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/flame/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -f out/target/product/flame/obj/ETC/product_file_contexts_intermediates/product_file_contexts -b out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/26.0_mapping.combined.cil -o out/target/product/flame/obj/ETC/treble_sepolicy_tests_26.0_intermediates/built_26.0_plat_sepolicy -p out/target/product/flame/obj/ETC/sepolicy_intermediates/sepolicy -u out/target/product/flame/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil )
14:14:43 ninja failed with: exit status 1

修改system/sepolicy/tests/Android.bp文件

    static_libs: [
        "libbase",
        "libsepol",
    ],
    //stl: "libc++_static",
    sanitize: {
        never: true,
    },

把stl: "libc++_static", 给注释掉

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4657380.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-06
下一篇 2022-11-06

发表评论

登录后才能评论

评论列表(0条)

保存