系统 ubuntu10.10
2.3 gingerbread的编译
1)sudo apt-get install bison
2)下载jdk-6u27-linux-i586.bin,解压。设置环境变量
在/etc/profile 后面添加
export JAVA_HOME=/home/amx/java/jdk1.6.0_27
PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
3)/bin/bash: g++:找不到命令
解决:sudo apt-get install g++
4)external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: 没有那个文件或目录
解决:sudo apt-get install zlib1g-dev
5)/bin/bash: flex:找不到命令
解决:sudo apt-get install flex
6)/usr/bin/ld: cannot find -lncurses
解决:sudo apt-get install libncurses5-dev
7)prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error: X11/Xlib.h: 没有那个文件或目录
解决:sudo apt-get install libx11-dev
8)sh: gperf: not found
解决:sudo apt-get install gperf
生成路径:
./out/target/product/generic/ramdisk.img
./out/target/product/generic/system.img
./out/target/product/generic/userdata.img
./prebuilt/android-arm/kernel/kernel-qemu
1.5 cupcake 的编译
1)frameworks/base/tools/aidl/AST.cpp:10: error: 'fprintf' was not declared in this scope的错误
解决办法:
下载gcc-4.3和g++-4.3: apt-get install gcc-4.3 g++-4.3
大约十多兆,然后进入/usr/bin
cd /usr/bin
建个软连接
ln -s gcc-4.3 gcc
ln -s g++-4.3 g++
然后进入android目录下,执行make,就可以了。
2)重复文件的错误 ,删除重复的文件。对于xml 和dom 目录重复的文件 删除dom对应的文件
1、java.util.zip.ZipException: duplicate entry: hyts_Foo.c 错误
- java.util.zip.ZipException: duplicate entry: hyts_Foo.c
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法:
这个问题是hyts_Foo.c文件重复,在根目录查找哪里重复,然后将其删除保留一个
$ find . -name hyts_Foo.c
./libcore/luni/src/test/resources/hyts_Foo.c
./libcore/support/src/test/resources/hyts_Foo.c
$ rm libcore/luni/src/test/resources/hyts_Foo.c
再次 make 即可
2、java.util.zip.ZipException: duplicate entry: staffNS.xml 错误
- java.util.zip.ZipException: duplicate entry: staffNS.xml
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法同上
3、java.util.zip.ZipException: duplicate entry: staff2.dtd 错误
- java.util.zip.ZipException: duplicate entry: staff2.dtd
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
同上
4、java.util.zip.ZipException: duplicate entry: xhtml1-strict.dtd错误
- java.util.zip.ZipException: duplicate entry: xhtml1-strict.dtd
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
- java.util.zip.ZipException: duplicate entry: staff2.xml 错误
解决办法同上
5、java.util.zip.ZipException: duplicate entry: staff2.xml错误
- java.util.zip.ZipException: duplicate entry: staff2.xml
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法同上
6、java.util.zip.ZipException: duplicate entry: hc_staff.xml 错误
- java.util.zip.ZipException: duplicate entry: hc_staff.xml
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法同上
7、java.util.zip.ZipException: duplicate entry: staff.xml 错误
- java.util.zip.ZipException: duplicate entry: staff.xml
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法同上
8、java.util.zip.ZipException: duplicate entry: staff.dtd 错误
- java.util.zip.ZipException: duplicate entry: staff.dtd
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法同上
9、java.util.zip.ZipException: duplicate entry: staffNS.dtd 错误
- java.util.zip.ZipException: duplicate entry: staffNS.dtd
- at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
- at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
- at sun.tools.jar.Main.addFile(Main.java:713)
- at sun.tools.jar.Main.update(Main.java:567)
- at sun.tools.jar.Main.run(Main.java:202)
- at sun.tools.jar.Main.main(Main.java:1149)
- make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1
- make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar'
解决办法同上