我有一个包含自定义View类的本地aar文件(包括res / values / attrs.xml文件)。
我知道默认情况下本地aar尚未运行,并且我尝试了此处建议的所有变通方法:如何使用新的Gradle Android Build System手动包括外部aar软件包(Ran和Vipul的答案)。
但是,这些解决方案似乎都没有采用自定义View类。我的意思是它不会出现在布局编辑器的“自定义视图”下。
应该行吗?还是需要一些额外的gradle-fu伏都教徒?
我遇到Android Studio识别本地导入的@aar库中的类的问题.
所以...我已经创建了一个库并导出了一个aar文件.在android工作室里面,我选择了Import Module他们Import .JAR or .AAR Package.
该项目编译并使用aar文件中的类,但Android工作室无法找到类或提供任何自动完成所有.
以下是一些截图:

使用相同方式导入的其他@aar库也会出现同样的问题:

有什么建议?
编辑:
的build.gradle:
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':UpPlatformSdk')
compile project(':simpleorm')
... // more libraries here
}
Run Code Online (Sandbox Code Playgroud)
settings.gradle:
include ':app', ':UpPlatformSdk', ':wear', ':simpleorm'
Run Code Online (Sandbox Code Playgroud) 我编写了一个 Flutter 插件来使用需要包含一些 .aar 模块的 SDK。它在插件的示例应用程序中构建并完美运行,但是当我在不同的应用程序中导入插件并尝试构建它时,构建立即失败并显示一条消息,指出在插入。这是没有意义的,因为模块肯定存在 - 如果模块不存在,则在示例应用程序中使用 SDK 的平台通道将失败。
为什么示例应用程序可以毫无问题地构建和运行,而不同的应用程序却不能?我唯一能想到的是我从 pubspec 中的路径导入插件,但在我看来这不太可能是罪魁祸首。
任何建议或帮助在这里将不胜感激。蒂亚!
使用 Android Studio 3.XX,将本地 .AAR 文件添加到 Android 项目不起作用(构建成功但运行时出现异常)
我尝试下面的方法(摘自参考来源:/sf/answers/1632847821/,/sf/answers/1742607121/等),但没有为我工作:
1. Import the local aar file:
(I) File>New>New Module>Import the .AAR Package [On "Finish" click the .AAR gets included automatically into settings.gradle file as below:
include ':app', ':myAAR'
(II) Add AAR module dependency in app level build.grdle file as below:
implementation project(":myAAR")
2. Using flatDir method:
(I) keep aar file in libs folder
(II) Add flatDir{dirs 'libs'} into the project level build.gradle file as below:
allprojects { …Run Code Online (Sandbox Code Playgroud)