使用CyanogenMod编译SDK遇到的问题总结

来源:互联网 发布:js渐变效果 编辑:程序博客网 时间:2024/06/08 19:53

使用CyanogenMod编译SDK遇到的问题总结

我编译的源码是CM11

一、编译方法

参考http://book.51cto.com/art/201212/374929.htm

$. build/envsetup.sh//这里容易出错的地方就是,build前有一个空格  $lunch sdk-eng//加载sdk-eng,默认是full-eng  $make sdk//编译SDK  

二、遇到的问题

1、错误提示一:

build/core/main.mk:667: *** : Module 'Gallery' in PRODUCT_PACKAGES has nothing to install!.  Stop.

类似这样的错误修改build/target/product/sdk.mk,把相应的模块去掉如删除Gallery \。

原因是CM11的不断,删除或更换了一些应用。

2、错误提示二:

/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/linux-x86/obj/STATIC_LIBRARIES/libusbx_intermediates/libusbx.a(linux_usbfs.o): In function `op_hotplug_poll':
/home/tony.wu/project_tony/code/cm/cm-11.0/external/libusbx/libusb/os/linux_usbfs.c:495: undefined reference to `linux_netlink_hotplug_poll'
/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/linux-x86/obj/STATIC_LIBRARIES/libusbx_intermediates/libusbx.a(linux_usbfs.o): In function `linux_stop_event_monitor':
/home/tony.wu/project_tony/code/cm/cm-11.0/external/libusbx/libusb/os/linux_usbfs.c:469: undefined reference to `linux_netlink_stop_event_monitor'
/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/linux-x86/obj/STATIC_LIBRARIES/libusbx_intermediates/libusbx.a(linux_usbfs.o): In function `linux_start_event_monitor':
/home/tony.wu/project_tony/code/cm/cm-11.0/external/libusbx/libusb/os/linux_usbfs.c:460: undefined reference to `linux_netlink_start_event_monitor'
/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/linux-x86/obj/STATIC_LIBRARIES/libusbx_intermediates/libusbx.a(linux_usbfs.o): In function `linux_stop_event_monitor':
/home/tony.wu/project_tony/code/cm/cm-11.0/external/libusbx/libusb/os/linux_usbfs.c:469: undefined reference to `linux_netlink_stop_event_monitor'
collect2: ld returned 1 exit status
make: *** [/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/linux-x86/obj/EXECUTABLES/heimdall_intermediates/heimdall] 错误 1

为编译通过,没有实际解决这个问题,只是粗暴地注释掉。

3、错误提示三:

## Running sdk/eclipse/scripts/create_all_symlinks.sh
### Starting tools/base: gradlew publishLocal
sdk/eclipse/scripts/create_all_symlinks.sh: 第 285 行: cd: tools/base: 没有那个文件或目录
make: *** [/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/linux-x86/obj/EXECUTABLES/monitor_intermediates/monitor] 错误 1

确实没有tools/base这个目录,而.repo/manifest.xml有定义。

根据https://groups.google.com/forum/#!msg/android-building/DpKnrpLMBgI/AEDpB4XA8e4J提示,需要"repo init -g all ; repo sync" 重新同步下来。

4、 错误提示四:

make: *** 没有规则可以创建“/home/tony.wu/project_tony/code/cm/cm-11.0/out/target/product/generic/obj/STATIC_LIBRARIES/libminui_intermediates/events.o”需要的目标“/home/tony.wu/project_tony/code/cm/cm-11.0/out/target/product/generic/obj/KERNEL_OBJ/usr”。 停止。
make: *** 正在等待未完成的任务....

将其它编译过的项目的KERNEL_OBJ目录复制过来

如:cp out/target/product/vivo/obj/KERNEL_OBJ/ out/target/product/generic/obj/KERNEL_OBJ/

5、错误提示五:

target Prebuilt:  (/home/tony.wu/project_tony/code/cm/cm-11.0/out/target/product/generic/kernel)
acp: missing destination file
make: *** [/home/tony.wu/project_tony/code/cm/cm-11.0/out/target/product/generic/kernel] 错误 2

将其它编译过的项目的kernel如cp out/target/product/vivo/kernel out/target/product/generic/kernel目录复制过来


至此编译生成了out\host\linux-x86\sdk\android-sdk_4c423d77ba_linux-x86.zip

这个是linux平台上使用的SDK,打开eclipse配置SDK的目录即可使用。


三、windows平台的SDK编译

$. build/envsetup.sh//这里容易出错的地方就是,build前有一个空格  $lunch sdk-eng//加载sdk-eng,默认是full-eng  $make win_sdk//编译SDK  

四、编win版本SDK遇到的问题

frameworks/native/include/binder/Parcel.h:69: 错误: expected ‘,’ or ‘...’ before ‘struct’
frameworks/native/include/binder/Parcel.h:78: 错误: expected ‘,’ or ‘...’ before ‘struct’
make[1]: *** [/home/tony.wu/project_tony/code/cm/cm-11.0/out/host/windows-x86/obj/STATIC_LIBRARIES/libandroidfw_intermediates/AssetManager.o] 错误 1

查看frameworks/native/include/binder/Parcel.h代码 

    // Writes the RPC header.
    status_t            writeInterfaceToken(const String16& interface);
    bool                enforceInterface(const String16& interface,
                                         IPCThreadState* threadState = NULL) const;

应该是interface 被宏义为struct。

所以在该文件中加入取消宏定义的代码。

#undef interface //加入的代码
class Parcel {


N久的等待,终于在out\host\windows\sdk\下生成SDK包。


0 0
原创粉丝点击