Compilation environment: Ubuntu12.04 64-bit
Android Source: Android 4.3
The following questions are personally encountered by the author, through the online query integration.
1.error while loading shared libraries:libz.so.1:cannot open Shared object file:no such file or directory
Here said can not load libz.so.1 this package, so need to download, the author used several methods, the following is their own use, the test is OK.
We use the command Apt-get search to install
Apt-get Install Apt-file
After installation, you are prompted to use the Apt-file update input to name
Apt-file is used to find a command or a package that contains a library, as follows
[Email protected]:/home/zhenghui# apt-file Search Libz.so.1
LIB32Z1:/usr/lib32/libz.so.1
LIB32Z1:/usr/lib32/libz.so.1.2.8
LIBX32Z1:/usr/libx32/libz.so.1
LIBX32Z1:/usr/libx32/libz.so.1.2.8
ZLIB1G:/lib/x86_64-linux-gnu/libz.so.1
ZLIB1G:/lib/x86_64-linux-gnu/libz.so.1.2.8
Here we find that we have found libz.so.1 so install the corresponding package, execute the command
Apt-get Install LIB32Z1
2. "Mkimage" command not found-u-boot images won't be built
From the internet said using Apt-get install Uboot-mkimage But the author has not been resolved, may be used in a different environment, the hint is:
[Email protected]:/home/zhenghui# apt-get Install Uboot-mkimage
Reading Package Lists ... Done
Building Dependency Tree
Reading state information ... Done
Package uboot-mkimage are not available, but are referred to by the another package.
This may mean and the package are missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
U-boot-tools:i386 U-boot-tools
E:package ' Uboot-mkimage ' has no installation candidate
Here say download two u-boot-tools:i386 and u-boot-tools two tools, install two tools here.
3.fatal error:zlib.h:no such file or directory
No zlib.h This file, install with command
Apt-get Install Zlib1g-dev
4.gperf not found
Workaround: Install Gperf
Apt-get Install Gperf
5./usr/bin/ld:cannot find-lncurses
Workaround: Install libncurses5-dev:i386 to get it done
Apt-get Install libncurses5-dev:i386
6.fatal error:uuid/uuid.h:no such file or directory
This is because the UUID software development package is not installed, use the command to resolve:
sudo apt-get install Uuid-dev
After the installation is finished, you may need to make a soft-link command:
Ln-sf/lib/i386-linux-gnu/libuuid.so.1/usr/lib/libuuid.so
7.Can ' t locate switch.pm in @INC
The workaround is to install the Perl Switch Library, which installs the command:
Apt-get Install Libswitch-perl
8./bin/bash:xmllint:command not found
Workaround Install the Xmllint command as follows:
Apt-get Install Libxml2-utils
9.make: * * * [Out/target/common/obj/java_libraries/framework_intermediates/noproguard.classes-with-local.dex] Killed
Online said memory is not enough, using a method to solve, increase the size of the swap partition, here is divided into 1G to swap partition:
To create a swap folder in the root directory:
mkdir Swap
CD Swap
sudo dd if=/dev/zero of=swapfile bs=1024 count=1048576
sudo mkswap swapfile//convert generated files to Swap files
sudo swapon swapfile//activating Swap files
If you need to uninstall. Execute command: Swapoff swapfile
After the Andorid compilation succeeds, three img:recovery.img, System.img, boot.img, and U-boot.bin are generated under/OUT/TARGET/PRODUCT/SABRESD_6DQ
Android source code compilation error Resolution