如何让 'framework.jar' 在 Android Studio 北极狐上的 'android.jar' 前面编译 [英] how to let 'framework.jar' compile in front of 'android.jar' on Android Studio Arctic Fox
问题描述
首先,在Android-Studio-Arctic-Fox
上如何让framework.jar
在android.jar
前面编译gradle 7.0.2
和 AGP-7.0.2
其次是让编辑器先从 framework.jar
导入以修复它不显示红色(找不到某些方法或字段或类)
First, how to let the framework.jar
compile in front of android.jar
on Android-Studio-Arctic-Fox
with gradle 7.0.2
and AGP-7.0.2
Second is let Editor first to import from the framework.jar
to fix it not display RED(cannot find some method or field or class)
推荐答案
目前无法使用自定义 jar 中的类覆盖 android.jar
- https://issuetracker.google.com/167750503.但是,您可以将 Android SDK 中的 android.jar
替换为您自己的,Android Studio 和 Android Gradle 插件会选择它们.
It is currently not possible to override android.jar
with classes from a custom jar - https://issuetracker.google.com/167750503. However, you could replace android.jar
in the Android SDK with your own, and Android Studio and Android Gradle plugin will pick them up.
或者,您可以开发 Sdk Add-on,以及将您的用户指向它.它会由 Android Studio 自动处理.这是一个关于如何构建一个的示例.
Alternatively, you can develop Sdk Add-on, and point your users to it. It will be automatically handled by Android Studio. Here is an example of how to build one.
这篇关于如何让 'framework.jar' 在 Android Studio 北极狐上的 'android.jar' 前面编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!