当前位置:网站首页>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)
}
}真机运行
边栏推荐
猜你喜欢

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

安装Multisim出现 No software will be installed or removed解决方法

Linux中mysql密码修改方法(亲测可用)

(Crypto essential dry goods) Detailed analysis of the current NFT trading markets
![[windows]--- SQL Server 2008 super detailed installation tutorial](/img/b7/dc802c63b07edc4298b6e6b90d865c.png)
[windows]--- SQL Server 2008 super detailed installation tutorial

For penetration testing methods where the output point is a timestamp (take Oracle database as an example)
Getting to know regular expressions

leetcode-每日一题735. 行星碰撞(栈模拟)

Eternal blue bug reappears

Error: Cannot find module ‘D:\Application\nodejs\node_modules\npm\bin\npm-cli.js‘
随机推荐
动态规划(一)| 斐波那契数列和归递
安装Multisim出现 No software will be installed or removed解决方法
对js的数组的理解
一文速学-玩转MySQL获取时间、格式转换各类操作方法详解
SQL注入中数据库的判断
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
gin框架学习-JWT认证
Digital twins will be an important way to enter the "metaverse"
win11中利用IIS10搭建asp网站
Redis:简单实用
Understanding SSRF, this article is enough
04 【计算属性 侦听属性】
How to distinguish big and small endian in C language
[Elastic-Job source code analysis] - job listener
C language tutorial (1) - preparation
leetcode-每日一题873. 最长的斐波那契子序列的长度(哈希和二分)
对于输出点是时间戳的渗透测试方法(以Oracle数据库为例)
阿里云中mysql数据库被攻击了,最终数据找回来了
数字孪生将成为进入“元宇宙”一项重要的途径
leetcode-每日一题731. 我的日程安排表 II