2016-10-10 89 views
0

我通過vagrant安裝了Ubuntu 16.04。但是,當我運行make Android 7.0時,會發生以下錯誤。Android 7.0 Build Error

有任何建議或建議嗎?

ninja: Entering directory `.' 
[ 0% 39/34804] host Java: ahat (out/ho...A_LIBRARIES/ahat_intermediates/classes 
Note: Some input files use unchecked or unsafe operations. 
Note: Recompile with -Xlint:unchecked for details. 
[ 0% 53/34804] Generating TOC: out/tar.../core-all_intermediates/classes.jar.to 
FAILED: /bin/bash -c "(out/host/linux-x86/bin/ijar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp) && (if cmp -s out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; then rm out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ; else mv out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; fi)" 
output_length=16459012 
Unable to open output file out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp: Invalid argument 
/bin/bash: line 1: 13460 Aborted     (core dumped) (out/host/linux-x86/bin/ijar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp) 
ninja: build stopped: subcommand failed. 
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed 
make: *** [ninja_wrapper] Error 1 

回答

1

我認爲這是爲Invalid argument for read-write mmap?

爲同一如果一定要使用共享文件夾,請修改 編譯/工具/ ijar/zip.cc

@@ -994,7 +994,7 @@ ZipBuilder* ZipBuilder::Create(const char* zip_file, u8 estimated_size) { 
    (u8) std::numeric_limits<size_t>::max()) 
    void *zipdata_out = mmap(NULL, mmap_length, PROT_WRITE, 
-       MAP_SHARED, fd_out, 0); 
+       MAP_SHARED | MAP_ANONYMOUS, fd_out, 0); 
    if (zipdata_out == MAP_FAILED) { 
     fprintf(stderr, "output_length=%llu\n", estimated_size); 
     return NULL; 

https://groups.google.com/forum/#!topic/android-building/qXsk-YpMdYo也許是相同的和你一樣。

我希望它是有用的。

+0

格式爲err.please修改ZipBuilder :: Create()方法中的代碼:MAP_SHARED - > MAP_SHARED | MAP_ANONYMOUS – user7063108

+0

雖然這個鏈接可能回答這個問題,但最好在這裏包含答案的重要部分,並提供參考鏈接。如果鏈接頁面更改,則僅鏈接答案可能會失效。 - [發表評論](/ review/low-quality-posts/14077868) –

+0

感謝Jignesh Ansodariya。基本部分是ijar exe在build/tools/ijar/zip.cc中使用mmap。當你在VM上構建AndroidN時,如果文件夾位於共享文件夾中,則會出現關於mmap的錯誤。您可以在ZipBuilder :: Create()方法中將代碼:mmap(xxx,xxx,MAP_SHARED,xxx)修復爲mmap(xxx,xxx,MAP_SHARED | MAP_ANONYMOUS,xxx) ,我認爲它會好的,否則你需要將代碼移動到不共享文件夾。不過,我的英語水平很差。 – user7063108