1. 程式人生 > >編譯Android 2.3原始碼錯誤總結

編譯Android 2.3原始碼錯誤總結

雖然版本2.3很老了,但是這是在完全新的Ubuntu上面編譯的,可以使我們更加熟練.

1.

host C: acp <= build/tools/acp/acp.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
In file included from /usr/include/stdlib.h:24:0,
                 from build/tools/acp/acp.c:11:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
                         ^
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

解決
sudo apt-get install libc6-dev-i386      //  Embedded GNU C Library: 32-bit development libraries for AMD64
sudo apt-get install libx32gcc-4.8-dev
sudo apt-get install lib32readline-gplv2-dev

libc6-dev 的解釋      Embedded GNU C Library: Development Libraries and Header Files
gcc-multilib   的解釋 GNU C compiler (multilib files)

2.
host C++: libhost <= build/libs/host/pseudolocalize.cpp
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
In file included from build/libs/host/include/host/pseudolocalize.h:4:0,
                 from build/libs/host/pseudolocalize.cpp:1:
/usr/include/c++/4.8/string:38:28: fatal error: bits/c++config.h: No such file or directory
 #include <bits/c++config.h>
                            ^
compilation terminated.
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] Error 1

解決:
sudo apt-get install gcc-4.8-multilib g++-4.8-multilib

3.
frameworks/base/tools/aapt/AaptAssets.cpp:1447:53:   required from here
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1

解決辦法:  frameworks/base/tools/aapt/Android.mk
       在第28行增加:
       LOCAL_CFLAGS += -Wno-format-y2k -fpermissive

4.
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::wp<android::AssetManager::SharedZip> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] Error 1

解決辦法:在 frameworks/base/libs/utils/Android.mk
在第60行後面增加-fpermissive:       
       LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

5.
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] 錯誤 1
    或者 make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1
解決辦法:cd external/srec
   複製拷貝下面的命令到終端:
     wget " https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff "
     patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
    rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
    cd ../..

6.
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
所以,這個問題只能修改原始碼來解決
在dalvik/vm/native/dalvik_system_Zygote.c中間增加一個頭檔案定義#include <sys/resource.h>
        #include "Dalvik.h"
        #include "native/InternalNativePriv.h"
        #include <sys/resource.h>
 
 /usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

解決:
sudo apt-get install lib32z1-dev

7.
collect2: error: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error

解決:
sudo apt-get install lib32ncurses5-dev

8.
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libext4_utils_intermediates/output_file.o] Error 1

解決:
由於系統的檔案換了位置, 此時需要將  /usr/include/x86_64-linux-gnu/zconfig.h 拷貝到上級目錄,此時編譯才通過
將 zconfig.h 拷貝到 /usr/include/ 目錄即可

9.

make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] error 1
解決辦法:系版本高,在配置環境的時候,gcc安裝了高到版本,所以gcc版本太高導致,需要降低gcc版本級別。
ubuntu 32bit系統下安裝gcc 4.4的最好方法是僅用以下兩條命令,不需要其它命令,否則編譯時可能會出錯。
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 300
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 300
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 350   
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 350

10.
g++: selected multilib '32' not installed
make: *** [out/host/linux-x86/obj/lib/libSR_Session.so] Error 1
make: *** Waiting for unfinished jobs....
target Prebuilt:  (out/target/product/generic/system/usr/share/bmd/RFFspeed_501.bmd)
g++: selected multilib '32' not installed
make: *** [out/host/linux-x86/obj/lib/libSR_Recognizer.so] Error 1

解決:
sudo apt-get install g++-4.4-multilib gcc-4.4-multilib

11.
BEGIN failed--compilation aborted at external/webkit/WebCore/dom/make_names.pl line 38.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/HTMLNames.cpp] Error 2

解決辦法:
sudo apt-get install libswitch-perl

12.
SDL init failure, reason is: No available video device  模擬器起不來

解決:

sudo apt-get install libsdl1.2debian:i386

下面是編譯2.2的時候遇到的問題

13.

make: *** [out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize] 錯誤 1

解決方法:
修改./framework/base/tools/localize/Android.mk檔案
ifeq ($(HOST_OS),linux)
#LOCAL_LDLIBS += -lrt       把這行註釋掉,改為下面一行。
LOCAL_LDLIBS += -lrt -lpthread
endif

14.

make: ***[out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/appt] 錯誤 1

解決方法:
開啟Android.mk檔案
$gedit frameworks/base/tools/aapt/Android.mk
編輯下面一行:
ifeq ($(HOST_OS),linux)
#LOCAL_LDLIBS += -lrt       把這行註釋掉,改為下面一行。
LOCAL_LDLIBS += -lrt -lpthread
endif

DescriptionResourcePathLocationType
Project 'AOSP' is missing required library: 'out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar'AOSPBuild pathBuild Path Problem
  out/target/common/obj/APPS/CalendarProvider_intermediates/src/src/com/android/providers/calendar/EventLogTags.java
    out/target/common/obj/APPS/ContactsProvider_intermediates/src/src/com/android/providers/contacts/EventLogTags.java

make sdk打包SDK,有了sdk包就可以在IDE環境中開發安卓應用程式了
Package SDK Stubs: out/target/common/obj/PACKAGING/android_jar_intermediates/android.jar
Package SDK: out/host/linux-x86/sdk/android-sdk_eng.mec_linux-x86.zip
zImage檔案預設位於原始碼根目錄下的子目錄
/prebuilt/android-arm/kernel/kernel-qemu

編譯安卓4.1報錯

make: *** [out/target/product/generic/system/etc/apns-conf.xml] Error 127  安裝下面的軟體

[email protected]:~/jellybean$ sudo apt-get  install libxml2-utils

相關推薦

編譯Android 2.3原始碼錯誤總結

雖然版本2.3很老了,但是這是在完全新的Ubuntu上面編譯的,可以使我們更加熟練. 1. host C: acp <= build/tools/acp/acp.c <command-line>:0:0: warning: "_FORTIFY_SOURCE

Ubuntu 14.04編譯Android 2.3.7原始碼記錄

編譯環境 下載原始碼 下載原始碼 Android 2.3.7r1 原始碼,原本按照谷歌官方的指導,需要下載repo同步AOSP,但是遇到太多問題,並且.repo 檔案相當大,下載耗時太久,而且很容易出現問題,而且所以直接下載別人打包好的7z

Android(2.3+)原始碼分析MediaPlayer之RTSP

在前面的部落格中有簡單介紹MediaPlayer,最近又開始研究這塊東西,在此把閱讀程式碼的理解記錄下來方便以後快速查閱。 播放普通檔案傳入的url是一個本地的絕對路徑,但是流媒體的話傳入的就是一個網路地址如以"http://“開頭的流媒體和以"rtsp://"開頭的流媒體

android 2.3原始碼下載

系統:Ubuntu 12.04 64 下載的步驟很簡單,其實就官方那幾步, $ mkdir ~/bin $ PATH=~/bin:$PATH$ curl http://commondatastorage.googleapis.com/git-repo-downloads

ubuntu16.04下編譯android-goldfish-3.4核心原始碼(android6.0.1系統原始碼)

配置 筆者環境 系統: ubuntu 16.04 LTS 硬碟: 固態硬碟 筆者剛開始直接克隆的時候出現如下錯誤: error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexp

Tools:downloading and Building EDK II工具篇:安裝/使用EDKII原始碼獲取/編譯工具[2.3]

Tools:Installing and using the Required Tools for downloading and Building EDK II工具篇:安裝/使用EDKII原始碼獲取/編譯工具[2.3] 2015-07 北京海淀區  張俊浩 2. Set

Ubuntu(64位)編譯Android源碼常見錯誤解決辦法

androi box track generic perf prop csdn AI not find 2013年07月10日 14:47:27 閱讀數:1239 錯誤: /usr/include/gnu/stubs.h:7:27: error: gnu/s

Android 2.3版本butterknife匯入使用

1,module下的build.gradle下新增 compile 'com.jakewharton:butterknife:8.4.0' apt 'com.jakewharton:butterknife-compiler:8.4.0' apply plugin: 'com.

ubuntu 18.04編譯Android 7.1原始碼

一、提前安裝軟體 1.安裝openjdk 1) 編譯的時候使用的是openjdk,跟我們平時使用的jdk並不一樣,可以到 http://openjdk.java.net/ 下載安裝,也可以通過下面的指令安裝。 sudo apt-get update sudo apt-get instal

Mac 10.14 編譯Android 8.1原始碼及刷入nexus 6p

環境準備 官網 描述得已經相當清楚了 ,這裡稍微總結一下: 建立區分大小寫的磁碟映像 mac系統預設是不區分大小寫的,所以我們需要建立一個區分大小寫的檔案系統 hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 6

Mac上下載編譯Android 6.0原始碼詳細記錄

第一步: 使用命令建立一個字尾為.dmg或.dmg.sparseimage的映象檔案 $ hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 80g ~/

spark 2.3原始碼分析之ShuffleInMemorySorter

PackedRecordPointer 概述 PackedRecordPointer物件用一個64bit的long型變數來記錄record資訊: [24 bit partition number][13 bit memory page number][27 bit

spark 2.3原始碼分析之SortShuffleWriter

SortShuffleWriter 概述 SortShuffleWriter它主要是判斷在Map端是否需要本地進行combine操作。如果需要聚合,則使用PartitionedAppendOnlyMap;如果不進行combine操作,則使用PartitionedPairB

spark 2.3原始碼分析之ShuffleDependency

ShuffleDependency 成員變數 - ShuffleHandle 在ShuffleDependency中建立ShuffleHandle. 如前面的部落格所述,有以下三種ShuffleHandle: BypassMergeSortShuffleHandle

Android 2.3.3中找到老版本的SDK Manager,並新增國內SDK更新源

1、Android 2.3.3中找到老版本的SDK Manager 方法1.在Android Studio中,點選 Tools -> Android -> Android Device Monitor, 在Android Device Monitor介面上點選

[Android 編譯(一)] Ubuntu 16.04 LTS 成功編譯 Android 6.0 原始碼教程

1 前言 經過3天奮戰,終於在Ubuntu 16.04上把Android 6.0的原始碼編譯出來了,各種配置,各種error,各種爬坑,特寫此部落格記錄爬坑經歷。先上圖,Ubuntu上編譯完後成功執行模擬器,如圖: 2 編譯環境 UbuntuKy

ubuntu編譯android4.0.3原始碼

1.ubuntu安裝 a.下載64位桌面版映象檔案ubuntu-12.10-desktop-amd64 b.下載EasyBCD     新增新條目——>NeoGrub——>安裝——>配置     新增     root (hd0,0)     kernel

android 2.3 除錯wm8960注意事項

以下是本人除錯wm8960的一些總結,是為以後除錯類似的東西做參考: 1、首先請檢查硬體問題,確保連線良好,有供電。 2、確定I2C能正常通訊,設定正常的通訊速率。 3、配置slave模式或master模式,注意配置0x7暫存器bit6(MS) 4、注意配置暫存器0x19暫

Ubuntu 16.04 64bit 編譯 Android 4.4 原始碼

1.獲取Android原始碼(1)下載repo在使用者目錄下建立一個bin資料夾來存放repo,並把該路徑設定到環境變數中mkdir ~/binPATH=~/bin:$PATH下載repo指令碼curl https://storage.googleapis.com/git-repo-downloads/rep

編譯Android Gallery相簿原始碼所遇bug

1. selectiveAdjust() isnot supported in SDK levels 11-15 Error:(99, 32) error: Non-root compute kernel selectiveAdjust() is no