当前位置: 首页 > news >正文

error: cannot find symbol import android.os.SystemProperties;

背景:AS独立编译系统工程应用,使用了hide接口,导致编译不过。

尽管使用了framework.jar依赖。依然编译不过,导致各种类找不到。

例如:

/SettingsLib/src/main/java/com/android/settingslib/location/RecentLocationApps.java:106: error: cannot find symbolAppOpsManager.PackageOps ops) {^symbol:   class PackageOpslocation: class AppOpsManager

解决方案:

加上下段代码解决(搭配openJDK 8)。

android{gradle.projectsEvaluated{tasks.withType(JavaCompile){Set<File> fileSet = options.bootstrapClasspath.getFiles()List<File> newFileList = new ArrayList<>();newFileList.add(new File("../commonLib/framework.jar"))newFileList.addAll(fileSet)options.bootstrapClasspath = files(newFileList.toArray())}}
}


http://www.mrgr.cn/news/50933.html

相关文章:

  • 阐述懒加载?
  • 嵌入式硬件设计
  • shell命令笔记记录
  • 贪吃蛇游戏(代码篇)
  • fork中的死锁问题
  • 【C】分支与循环2--while/for/do-while/goto以及break和continue在不同循环中的辨析~
  • Spring-Bean的实例化和依赖注入方式
  • SAP PP常用功能之 可配置 BOM 的实现(超级BOM)
  • RISC-V笔记——RVWMO基本体
  • Vs配置opencv库 实例,opencv选用4.9.0版本,vs版本是2022社版,学习笔记不断更新
  • Servlet复习
  • 阿拉伯应用市场的特点
  • jetson nano ubuntu20.04安装ros-Noetic
  • 运行Springboot + Vue 项目
  • 【力扣 | SQL题 | 每日3题】力扣2988,569,1132,1158
  • 大健康零售电商AI知识库:优化用户体验的新引擎
  • Linux 命令 —— grep、tail、head、cat、more、less(查看日志常用命令)
  • 获取vue实例
  • 【Linux】解锁线程基本概念和线程控制,步入多线程学习的大门
  • 2024腾讯全球数字生态大会 | 线上直播活动参与教程