九鼎创展论坛中文版English
登录 | 立即注册 设为首页收藏本站 切换到宽版
查看: 4962|回复: 0
打印 上一主题 下一主题

Framework编译AIDL文件

[复制链接]
跳转到指定楼层
楼主
发表于 2012-2-6 15:13:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

今天下午下载一个开源的Android系统,编译中老遇到如下aidl错误,思考了很久,终于找到解决办法。AIDL是什么?不清楚的可以google。这里重点是如何在android framework中添加新的接口。如下例子,如果没有添加AILD文件,编译系统的时候会出现如下错误。


frameworks/base/core/java/android/bluetooth/BluetoothHid.java:86: cannot find symbol

symbol  : class IBluetoothHid

location: class android.bluetooth.BluetoothHid

    private final IBluetoothHid mService;

                  ^

frameworks/base/core/java/android/server/BluetoothHidService.java:30: cannot find symbol

symbol  : class IBluetoothHid

location: package android.bluetooth

import android.bluetooth.IBluetoothHid;

                         ^

frameworks/base/core/java/android/server/BluetoothHidService.java:47: package IBluetoothHid does not exist

public class BluetoothHidService extends IBluetoothHid.Stub {

                                                      ^

frameworks/base/core/java/android/bluetooth/BluetoothHid.java:98: package IBluetoothHid does not exist

            mService = IBluetoothHid.Stub.asInterface(b);

                                    ^

frameworks/base/core/java/android/server/BluetoothHidService.java:142: cannot find symbol

symbol  : variable super

location: class android.server.BluetoothHidService

            super.finalize();

            ^

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

5 errors

6 warnings


解决办法:

在framework中的 Android.mk文件中添加

......


        core/java/android/app/backup/IBackupManager.aidl \

        core/java/android/app/backup/IRestoreObserver.aidl \

        core/java/android/app/backup/IRestoreSession.aidl \

        core/java/android/bluetooth/IBluetooth.aidl \

        core/java/android/bluetooth/IBluetoothA2dp.aidl \

        core/java/android/bluetooth/IBluetoothCallback.aidl \

        core/java/android/bluetooth/IBluetoothHeadset.aidl \

       core/java/android/bluetooth/IBluetoothHid.aidl \

        core/java/android/bluetooth/IBluetoothPbap.aidl \

        core/java/android/content/IContentService.aidl \

        core/java/android/content/IIntentReceiver.aidl \

        core/java/android/content/IIntentSender.aidl \

        core/java/android/content/ISyncAdapter.aidl \


......


有错误出来了,ok跟着做。

******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
   1) You can add "@hide" javadoc comments to the methods, etc. listed in the
      errors above.
   2) You can update current.xml by executing the following command:
         make update-api
      To submit the revised current.xml to the main Android repository,
      you will need approval.
******************************

make updata-api --更新系统api


>>>>>>finish


make -j8  --重新编译


ok编译顺利通过。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|深圳市九鼎创展科技官方论坛 ( 粤ICP备11028681号-2  

GMT+8, 2024-6-14 01:33 , Processed in 0.019677 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表