編輯:中級開發
1. 編譯時出現/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-Linux-gnu/4.4.5/../../../libz.so when searching for -lz
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv5te
HOST_ARCH=x86
HOST_OS=Linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
host Executable: aapt (out/host/Linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-Linux-gnu/4.4.5/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-Linux-gnu/4.4.5/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.a when searching for -lz
/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
2. [android]編譯時出現 /usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory 錯誤信息
編譯時出現 /usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv5te
HOST_ARCH=x86
HOST_OS=Linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
host C: acp <= build/tools/acp/acp.c
In file included from /usr/include/features.h:387,
from /usr/include/stdlib.h:25,
from build/tools/acp/acp.c:11:
/usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
compilation terminated.
make: *** [out/host/Linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1
解決辦法: 缺少libc開發包,安裝即可: apt-get install libc6-dev-i386
3. 編譯時出現 /usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv5te
HOST_ARCH=x86
HOST_OS=Linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
host C: acp <= build/tools/acp/acp.c
In file included from /usr/include/features.h:387,
from /usr/include/stdlib.h:25,
from build/tools/acp/acp.c:11:
/usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
compilation terminated.
make: *** [out/host/Linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1
解決辦法:缺少libc開發包,安裝即可: apt-get install libc6-dev-i386
4. [android]初始化代碼倉庫時出現“OSError: [Errno 2] No such file or directory”錯誤
OSError: [Errno 2] No such file or directoryroot@shanmin-ubuntu:/home/android/src# ../repo init -u git://android.git.kernel.org/platform/manifest.git
Traceback (most recent call last):
File "../repo", line 595, in <module>
main(sys.argv[1:])
File "../repo", line 562, in main
_Init(args)
File "../repo", line 181, in _Init
_CheckGitVersion()
File "../repo", line 210, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/usr/lib/Python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/usr/lib/Python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
解決辦法: 這是由於沒有安裝git造成的,安裝上git就可以了。按說程序裡面應該判斷一下系統是否安裝了git,不知道為什麼沒有判斷。 apt-get install git
5. 太不容易了,終於看到自己編譯的android了
可能是我使用的機器比較慢,虛擬機運行的有些慢啊。。。。
太不容易了,終於看到自己編譯的android了 - -
下一步開始研究這個系統怎樣去定制了....
編譯android,遇到Your version is: /bin/bash: Java: command not found.錯誤的解決
Your version is: /bin/bash: Java: command not found.============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=Linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
/bin/bash: bison: command not found
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of Java.
Your version is: /bin/bash: Java: command not found.
The correct version is: 1.6.
Please follow the Machine setup instructions at
http://source.android.com/source/download.Html
************************************************************
build/core/main.mk:114: *** stop. Stop.
解決辦法: 這是由於沒有裝jdk導致的,可以到sun.com下載jdk後安裝,建議安裝到/usr/lib /jvm目錄下,例如我下載的安裝文件為 jdk-6u21-Linux-i586.bin,安裝完後生成一個jdk1.6.0_21的目錄,然後使用ln -s jdk1.6.0_21 Java-6-sun命令做一個鏈接,這樣以後再升級sun jdk時只需要改動一下鏈接就可以了。
6. 編譯android,遇到Could not load 'clearsilver-jni'錯誤的解決
Could not load 'clearsilver-jni'===========================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=Linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
Docs droiddoc: out/target/common/docs/api-stubs
Could not load 'clearsilver-jni'
Java.library.path = out/host/Linux-x86/lib
make: *** [out/target/common/docs/api-stubs-timestamp] Error 45
從網上查得的解決辦法:
make clean
make update-api (經測試,這個可以不需要)
make
7. android編譯環境中的JDK存放位置
因為Ubuntu 10.04已經不帶有SUN JDK,所以這個需要到sun網站上下載,並手動安裝。所以,這個安裝位置的問題就出現了。開始的時候沒有注意,隨便找了一個位置,並且設置了 JAVA_HOME就可以正常使用了。後來查看build/envsetup.sh才發現,如果沒有設置JAVA_HOME的時候,編譯環境會自動設置為 /usr/lib/jvm/Java-6-sun ,所以建議直接安裝到這個目錄,還省得進行設置。
杯具了,VMware虛擬盤文件出現錯誤...
暈死了,不說別的,就下載android的源代碼就得差不多一天啊......
杯具了,VMware虛擬盤文件出現錯誤... - -
似乎昨晚關機的時候強關的機器,沒想到會影響這麼大。。。。。
8. android編譯遇到錯誤/usr/bin/ld: cannot find -lstdc++的解決
首先發現編譯2.2版,gcc4.3和gcc4.4沒有什麼區別。
/usr/bin/ld: cannot find -lstdc++
============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=Linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
host SharedLib: libneo_util (out/host/Linux-x86/obj/lib/libneo_util.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/Linux-x86/obj/lib/libneo_util.so] 錯誤 1
解決辦法:缺少g++-multilib庫,安裝即可: apt-get install g++-multilib
9. android編譯遇到錯誤
環境: vmware + ubuntu 10.04
使用gcc 4.3或gcc 4.4都會出錯誤信息:
host SharedLib: libneo_util (out/host/Linux-x86/obj/lib/libneo_util.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-Linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/Linux-x86/obj/lib/libneo_util.so] 錯誤 1
現在不知道怎麼解決,按照http://www.ways2u.com/?post=163 寫的使用gcc 4.3就不會有這個問題,但我這邊還是出現這個錯誤。。。。
10. android編譯環境
android所有源代碼在 http://android.git.kernel.org/
如果在Windows下只能使用git一個項目一個項目的下載,如果在Linux可以直接使用repo下載全部代碼
Linux下的全部下載方式見http://source.android.com/source/git-repo.Html
必須安裝gcc 4.3才可以,例如我用的ubuntu 10.04默認裝的是4.4,編譯就會出錯。
在裝完Eclipse & SDK後,編譯android需要安裝部分軟件:
apt-get install bison
apt-get install g++
apt-get install libc6-dev-amd64
到源代碼目錄執行
make
即可
在Android 3.0中除了我們重點講解的Fragment外,Action Bar也是一個重要的內容,Action Bar主要是用於代替傳統的標題欄,對於androi
本文節選於機械工業出版社推出的《Android應用開發揭秘》一書,作者為楊豐盛。本書內容全面,詳細講解了Android框架、android組件、用戶界面開發、游戲開發、
簡介: 有幾個網站從事一些非盈利服務,提供一些可輕松設置和使用的表單來進行民意測驗和數據收集。本教程介紹一個簡單的架構來為 android 設計類似的應用程
簡介: 學習如何使用混合應用程序編程模型為 WebSphere® Commerce 構建移動應用程序。本文描述混合模型,它與其他移動應用程序編程模型的