原创, 转载请注明链接!
问题背景:
我们需要在fwk中修改一些东西并以aidl的方式提供给Launcher或者其他app使用. aidl服务端怎么实现这里不多解释, 不会的同学自己去科普一下就行了
在这里, 我是想记录一下我在调用的地方遇到的一些问题:
我把我的aidl文件放在/vendor/boxing/frameworks/base/core/java里面,
此时运行aidl --lang=java ./com/upuphone/bxglobalwindow/IGlobalWindowInterface.aidl -o .
噢活, 报错了. 错误信息如下:
ERROR: ./com/upuphone/bxglobalwindow/IGlobalWindowInterface.aidl: Couldn't find import for class android.window.WindowContainerToken
好呗, 这东西以前确实没用过, 讲道理这个命令我也是google的 意思就是找不到类呗.
好了, 接下来怎么办呢? 那么根据以往的经验, aidl这个命令应该是可以指定类似与java -classpath这种指定classpath的参数.. 不多说, 干它! 输入aidl 出来下面这些东西
: AIDL Compiler: built for platform SDK version 31
usage:
aidl --lang={java|cpp|ndk|rust} [OPTION]... INPUT...
Generate Java, C++ or Rust files for AIDL file(s).
aidl --preprocess OUTPUT INPUT...
Create an AIDL file having declarations of AIDL file(s).
aidl --dumpapi --out=DIR IN