Ubuntu 18.04编译android_8_1_0_r1遇到的一个疑难杂症target Generated: android.hardware.usb-V1.1-java

虚拟机:Parallels Destop 16
本机:Mac 10.15.7
1、先说环境准备,因为PD是共享宿主机硬盘直接用的话他的硬盘格式跟Mac一样
所以需要跟mac一样创建一个大小写敏感的镜像,然后将源码放进去就可以了。
2、target Generated: android.hardware.usb-V1.1-java
这个错在百度搜基本搜不出来,后面在google group搜到的
具体原因:文件系统为未知格式,源码里没有做处理需要修改system/tools/hidl/Coordinator.cpp

看下代码对比图:
请添加图片描述
1、搜索while ((ent = readdir(dir)) != NULL) {
2、将

     if (ent->d_type != DT_REG) {
            continue;

替换为

if (ent->d_type == DT_UNKNOWN) {

struct stat sb;

const auto filename = packagePath + std::string(ent->d_name);

if (stat(filename.c_str(), &sb) == -1) {

fprintf(stderr, "ERROR: Could not stat %s\n", filename.c_str());

return -errno;

}
if ((sb.st_mode & S_IFMT) != S_IFREG) {

continue;
}
} else if (ent->d_type != DT_REG) {

continue;
}

保存、编译,美滋滋。
在这里插入图片描述

好了,打完收工。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值