当前位置:网站首页>flutter 混合开发 module 依赖
flutter 混合开发 module 依赖
2022-07-31 05:15:00 【为今天而努力】
一:创建android 工程。
二:创建flutter_libary

三:配置 flutter
1.工程对应的 build.gradle
maven 使用 aliyun 镜像,防止出现一些找不到问题。
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://storage.googleapis.com//download.flutter.io'}
}
}2.工程对应的 setting.gradle
setBinding(new Binding([gradle:this]))
//flutter目录
evaluate(new File(
settingsDir.parentFile,
'flutter_library/.android/include_flutter.groovy'
))new Binding([gradle:this]) 如果出错,标识确实对应的 jar【package groovy.lang.Binding;】
groovy-all-1.3-2.5.12.jar
我自己用的 gradle 版本为: 7.2-bin ,对应的文件目录,没有该文件
c\Users\user\.gradle\wrapper\dists\gradle-7.2-bin\2dnblmf4td7x66yl1d74lt32g\gradle-7.2\lib\
user --> 对应的自己的账户名称
处理方案:重其他版本查找。在..\gradle-6.7\lib\groovy-all-1.3-2.5.12.jar 找到该文件,拷贝致 gradle-7.2\lib\groovy-all-1.3-2.5.12.jar
需要重启android studio。
3.app 目录下的 build.gradle 增加
implementation project(':flutter')dependencies {
...
implementation project(':flutter')
}4.创建 activity : FlutterActivity【Java extends】
import io.flutter.embedding.android.FlutterActivity
class FlutterActivityTest : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}真机运行
边栏推荐
- Using IIS10 to build an asp website in win11
- Yuan prospect and four track of the universe
- vulhub靶场学习日记hackme1
- The latest MySql installation teaching, very detailed
- Digital twins will be an important way to enter the "metaverse"
- Linux modify MySQL database password
- 动态规划(一)| 斐波那契数列和归递
- C语言 | 获取字符串里逗号间隔的内容
- MySQL面试题大全(陆续更新)
- leetcode-每日一题565. 数组嵌套(标记图和并查集)
猜你喜欢

DeFi 项目中的治理Token

Install mysqldb in mac10.14

阿里云中mysql数据库被攻击了,最终数据找回来了

gin框架学习-Casbin入门指南(ACL、RBAC、域内RBAC模型)

Yuan prospect and four track of the universe

vulhub靶场学习日记SickOs1.2

NFTs: The Heart of Digital Ownership

vulhub靶场学习日记hackme2

为什么redis是单线程还那么快?

The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
随机推荐
MySQL-如何分库分表?一看就懂
Eternal blue bug reappears
Understanding SSRF, this article is enough
碎片化NFT(Fractional NFT)
安装Multisim出现 No software will be installed or removed解决方法
数字取证autopsy工具用法
Linux修改MySQL数据库密码
数字孪生将成为进入“元宇宙”一项重要的途径
vulhub靶场学习日记xxe-lab
leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
[Elastic-Job source code analysis] - job listener
js中的全局作用域与函数作用域
Common JVM interview questions and answers
动态规划(一)| 斐波那契数列和归递
年终总结——岁月静好~
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
通信原理——纠错编码 | 汉明码(海明码)手算详解
On the side of Ali, tell me what are the application scenarios of message middleware you know?
正则表达式基础知识
GUCCI, LV and other luxury giant universe how to layout yuan, other brands should keep up with?