

如何在flutter插件中使用本地aar库
source link: https://www.myfreax.com/how-to-use-local-aar-inside-flutter-plugin/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

如何在flutter插件中使用本地aar库
当你使用Golang语言编写一个android安卓的库,并且编译为android的arr格式库时,你需要配置你gradle,让gradle寻找你所使用库的路径。
本文说明如何在flutter插件中使用本地aar库文件。
使用下面的flutter命令创建一个flutter插件
flutter create --org 你的包名 --template=plugin --platforms=android,ios -a kotlin 插件名称
然后创建一个libs
在插件的android
目录下,将生成的arr库存放在libs
下,如下图
I updated the build.gradle
file for the android code to include the following:
然后更新flutter插件的android项目build.gradle
文件,添加flatDir到repositories对象
rootProject.allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
并且将arr库添加到依赖
implementation fileTree(dir: 'libs', include: ['*.aar'])
Recommend
-
23
如果您希望能有一种简单、高效且灵活的方式把 TensorFlow 模型集成到 Flutter 应用里,那请您一定不要错过我们今天介绍...
-
10
Flutter混合开发之打包aar并上传到nexus 今天我必须得写篇博客来记录下这“历史性”的时刻,耗时3天终于算是搞出来了。此时此刻只有一张图能形容我现在的状态。
-
7
使用 Github Action 发布 Flutter 插件 最后更新: 2020-12-15 阅读时间: 1 min 笔者有发布过几个 Flutter 插件,一直在手动更新。手动更新插件有点麻烦且容易失败(需要科学上网),因此研究了下如何使用
-
25
1 什么是Stream? Stream是Dart用来处理异步的API,和同样用来处理异步的Future不同的是,Stream可以异步的返回多个结果,而Future只能返回一个,如果你对Future有疑问,可以参考作者的上一篇文章,
-
6
昨天把 gradle 升级到 6.0 以后,发现这傻逼的 google 又直接干 API,以前上报的全部脚本都没法用了。我们原先上报一个 aar,是直接引入 apply plugin: 'maven' 结果新版本...
-
10
如何在IDEA中使用Java静态代码扫描插件之 SonarLint date_range更新于 2019/12/27 info 在我...
-
7
Android Studio 打包及引用 aar – Android开发中文站你的位置:Android开发中文站 > Android开发 >
-
5
Create an Android Library (AAR)Steps to create an Android library, blockers while creating it and how to resolve themPhoto by
-
2
Copy link Author
-
6
如何在PS里使用stable diffusion插件? 1月 26, 2024 发表于: AI绘画教程.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK