第一次編譯aosp的android源碼,問題很多,有些文件拒絕訪問時,需要對這些文件的權限進行設置。
============================================
find: `frameworks/base/frameworks/base/docs/html': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `frameworks/base/frameworks/base/docs/html': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `frameworks/base/frameworks/base/docs/html': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `frameworks/base/frameworks/base/docs/html': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `frameworks/base/frameworks/base/docs/html': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
Makefile:1279: *** mixed implicit and normal rules. Stop.
Makefile:1279: *** mixed implicit and normal rules. Stop.
Makefile:1279: *** mixed implicit and normal rules. Stop.
*** glibc detected *** make: free(): invalid next size (fast): 0x0000000008d1b330 ***
======= Backtrace: =========
find提示的內容可以忽略,最終還是可以編譯成功,另外有有一個錯誤是提示沒有g++,直接sudo apt-get install g++即可;下面是一些具體的錯誤以及最后的解決辦法:
錯誤:消除*** glibc detected *** make: free(): invalid next size (fast):
解決: make-3.81.tar.gz(之前安裝的3.82,這個版本貌似有問題)
錯誤:/usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
解決:$sudo apt-get install libc6-dev-i386
錯誤:external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory
解決:$sudo apt-get install zlib1g-dev
錯誤:Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
解決:$sudo apt-get install flex
錯誤:bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127
解決:sudo apt-get install bison
錯誤:/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] Error 1
解決:sudo ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so
(However this helped: sudo ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so
Was trying to compile 32bit software with an 64bit environment.)
錯誤:development/tools/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp:22: fatal error: GL/glx.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error 1
解決:sudo apt-get install libgl1-mesa-dev
錯誤:/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1
解決:缺少lib32z1-dev安裝即可:apt-get install lib32z1-dev
錯誤:target Java: CtsVerifier (out/target/common/obj/APPS/CtsVerifier_intermediates/classes)
cts/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java:191: onCreateDialog(int,android.os.Bundle) in android.app.Activity cannot implement onCreateDialog(int,android.os.Bundle) in com.android.cts.verifier.PassFailButtons.PassFailActivity; attempting to assign weaker access privileges; was public
private static
^
1 error
make: *** [out/target/common/obj/APPS/CtsVerifier_intermediates/classes-full-debug.jar] Error 41
解決:
參考資料
1.http://thesoftwarerogue.blogspot.jp/
2.http://groups.google.com/group/android-building/browse_thread/thread/14023f6d53d16921
3.http://superuser.com/questions/353983/how-do-i-install-the-sun-java-sdk-in-ubuntu-11-10-oneric
4.http://source.android.com/source/initializing.html
5.http://www.360doc.com/content/12/0314/11/474846_194227428.shtml
有人說問題是系統(tǒng)自動使用的是OpenJdk,而應該參照4中使用sun的jdk,編譯Gingerbread以上版本使用JDK 6,而Froyo以及以下舊版本使用JDK 5。但我與2中說的一樣,我修改來JDK之后依然沒有解決,現在使用5中的辦法來嘗試。
經過長時間的等待,終于完成來aosp的編譯,最后出現:
Target system fs image: out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img
Install system fs image: out/target/product/generic/system.img
Installed file list: out/target/product/generic/installed-files.txt
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現有害或侵權內容,請
點擊舉報。