android安装时编译,android编译时安装一些包

注:android应使用Java6与gcc 4.4

摘自:http://blog.chinaunix.net/uid-24448954-id-3206913.html

摘录:

错误处理

在Ubuntu10.10(64位)编译Android2.3源码时,遇到各种各样的问题。不是缺这个,就是少那个。现把这些问题和解决方法罗列出来,供

大家参考。

错误:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file

or directory

make: ***

[out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] 错误

1

解决:

sudo apt-get install libc6-dev-i386

错误:

make: ***

[out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] error

1

解决:

sudo apt-get install g++-multilib

错误:

external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such

file or directory

compilation terminated.

make: ***

[out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o]

Error 1

解决:

sudo apt-get install zlib1g-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

解决:

sudo apt-get install lib32z1-dev

错误:

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

错误:

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

错误:

/usr/bin/ld: cannot find -lncurses

collect2: ld returned 1 exit status

make: ***

[out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error

1

解决:

sudo apt-get install lib32ncurses5-dev

错误:

prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error:

X11/Xlib.h: No such file or directory

compilation terminated.

make: ***

[out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/main-common.o]

Error 1

解决:

sudo apt-get install libx11-dev

错误:

sh: gperf: not found

calling gperf failed: 32512 at ./makeprop.pl line 96.

make: ***

[out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h]

Error 25

make: *** Deleting file

`out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'

解决:

sudo apt-get install gperf

错误:

build/core/java.mk:9: *** bin: Target java module does not define

any source or resource files. Stop.

解决:

除源码根目录下的bin文件夹,这个文件夹是导入eclipse时创建的。

cannot find -lXXX

所有编译过程中遇到的类似这样的错误,都是缺少libXXX这样的库,解决方法就是:

首先: 利用命令:apt-cache search XXX 进行库搜索

然后:找那些libXXX-dev这样的库进行安装,命令就是:sudo

apt-get install libXXX-dev

最后:继续执行make

摘自:http://blog.csdn.net/caimouse/article/details/7107080

external/mesa3d/src/glsl/linker.cpp:1734:50: error: ‘fragColor’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1

解决这个问题需要修改文件如下:

把 "#include " 添 到 linker.cpp 文件头部。

这 就可以编译完成了。

摘自:http://hi.baidu.com/hyemiletoe/item/0403f331f12017179cc65ed9In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:

external/oprofile/libpp/format_output.h:94:22: 错误: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]

解决办法: external/oprofile/libpp/format_output.h 把: mutable counts_t & counts; 改为: counts_t & counts;

摘自:http://blog.csdn.net/zhbpd/article/details/7680835

external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type

make[2]: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_main_host_intermediates/gtest_main.o] Error 1

解决办法:

$vim

external/gtest/src/../include/gtest/internal/gtest-param-util.h

添加:

#include

摘自:http://blog.sina.com.cn/s/blog_ab85e99501018r6x.html

一些错误需要使用gcc4.4来避免

摘自:http://www.blogjava.net/ZircoN/archive/2011/11/13/363452.html

sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev x11proto-core-dev libx11-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils

cce544e7261bf3a4535656c82b969b03.png

转发至微博

cce544e7261bf3a4535656c82b969b03.png

转发至微博

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android Gradle是一种用于构建和管理Android应用程序项目的工具。它的一个重要功能就是打编译资源。 在Android Gradle中,资源是指应用程序使用的各种非代码文件,如图像、布局文件、字符串、样式等。这些资源文件需要经过打编译的过程才能被应用程序使用。 打资源的过程是指将应用程序使用的所有资源文件收集起来,打成一个或多个二进制资源文件(.arsc),以方便应用程序在运行访问。这个过程由Gradle的打任务完成。打后的资源文件会被放置在应用程序的res目录下的各个res-qualified目录中。 编译资源的过程是指将资源文件从其源文件形式编译成二进制格式,以便应用程序可以在运行使用它们。这个过程由Android资源编译器(AAPT)完成。编译资源的过程括对资源文件进行验证、解析和优化,最终生成资源文件的二进制表示形式。 要在Android Gradle项目中进行资源的打编译,我们需要在项目的build.gradle文件中配置相应的构建规则和参数。其中,可以通过设置资源文件的名称、路径、扩展名等属性来指定要打编译的资源文件。此外,还可以通过配置资源的qualifier(如屏幕密度、语言等)来实现对不同设备和语言环境的资源适配。 通过Android Gradle的打编译资源功能,我们可以方便地管理和使用应用程序的各种资源文件,使应用程序在不同设备和语言环境下都能正确地加载和显示相应的资源。这对于开发多语言和多平台的应用程序来说,是非常重要的。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值