fultter项目运行报错,Android不兼容问题
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
意思是 gradle失败可能因为AndroidX不兼容flutter app ,参考这个文档https://goo.gl/CP92wY去修复它
打开文档,说的很详细,大家有兴趣可以自己阅读,我这里做一下简单的解决
修复方式有两种
第一种:通过Android studio 迁移你的项目(推荐)
第一步:会打开一个新的Android项目的窗口
第二步:Android是 studio打开了一个新的Android窗口
在android项目里,setting-plugin,查看是否安装插件 Android support,如果没有去安装一下,一般应该都装了的
第三步:
以上我感觉这些设置默认的都没问题,可以不去修改。直接进行下面的操作。如果不行,再弄一下上面的
最重要的部分:迁移到AndroidX 很重要
一切ok,重新运行一下你的flutter项目吧
第二种:手动迁移你的项目(不推荐)
1.修改android/gradle/wrapper/gradle-wrapper.properties这个文件的像这样
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
2.修改android/build.gradle文件
dependencies {classpath 'com.android.tools.build:gradle:3.2.1'
}
这个改成这个
dependencies {classpath 'com.android.tools.build:gradle:3.3.0'
}
3.修改这个文件android/gradle.properties
android.enableJetifier=true
android.useAndroidX=true
没有这两个请添加
4.这个文件里android/app/build.gradle
在 android { 里确保compileSdkVersion和targetSdkVersion是最新的28
5.在android/app/build.gradle
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner
替换成
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"dependencies { 里的
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
替换成
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
应该就可以了,因为这是不推荐的方法我就没去尝试,想去尝试的可以去试试。
最后:写博客不容易,一直以来觉得挺耽误时间,所以大家多多关注,谢谢
fultter项目运行报错,Android不兼容问题相关推荐
- vue/cle3项目运行报错sockjs-node/info解决方案
https://cloud.tencent.com/developer/article/1489598 vue/cle3项目运行报错sockjs-node/info解决方案 在这篇文章中: bug复现 ...
- 【项目运行报错】These dependencies were not found: core-js/modules/es6.array.fill in ./node_modules
项目运行报错 These dependencies were not found: core-js/modules/es6.array.fill in ./node_modules/cache-loa ...
- vue 项目运行报错 multiple chunks emit assts to the same filename js/401.js(chunks 401 and 401)
VUE项目运行报这个错误也没有说哪里有错误,只说有名字冲突,整个项目搜下来都没发现有相同的名字,百度也没人说.自己摸索的解决掉了.有两种情况. 情况一:如果是添加路由的时候就报这个错 解决办法: 把c ...
- 查看node的位置_升级Node版本RN项目运行报错cb.apply is not a function
今日打算安装一下ReactNative官方推荐的脚手架工具Ignite. infinitered/ignitegithub.com Ignite是一套整合了 Redux 以及一些常见 UI 组件的脚 ...
- vue项目运行报错 node_modules/.bin/vue-cli-service: Permission denied
vue项目运行 npm run serve 报错 sh: /Users/wang/WebstormProjects/test_web/node_modules/.bin/vue-cli-service ...
- Python项目运行报错 django.core.exceptions.ImproperlyConfigured: WSGI application ‘WebTool.wsgi.application
问题描述:使用Pycharm运行python项目报错:django.core.exceptions.ImproperlyConfigured: WSGI application 'WebTool.ws ...
- vue使用vuetify创建项目运行报错:error Component name XXX should always be multi-word vue/multi-word-compon
报错如下: You may use special comments to disable some warnings. Use // eslint-disable-next-line to igno ...
- 为什么PHP项目运行报错502,Nginx+PHP-FPM遇到的502报错
1 首先查看一下目前php-fpm的进程数量 ps aux |grep php-fpm |grep -v grep |grep "^www"|wc -l 将输出结果与nginx.c ...
- 为什么PHP项目运行报错502,Nginx + php-fpm 出现502错误分析
在nginx上跑php容易出现502错误,很多人遇到过这个问题,到底是什么原因导致的呢? 出现502错误后,又有哪些解决办法呢? 本文源起于前段时间处理无线浏览器的一次502报警后总结得来,希望能为大 ...
最新文章
- fedora java环境变量_Fedora Linux,JDK安装与配置环境变量
- 【域控管理】父域的搭建
- 离京2小时,快手百亿入云,一切为了「看见」
- 无法将Mac键盘、Mac鼠标和mac控板连接到Mac电脑的解决方法、速看~
- do_initcalls 初始化内核init段(设备驱动module_init 对应init6段)
- mybatis对象包含list类型属性的resultMap配置
- OBS录制的avi能够被imageJ打开吗?
- abaqus2018+intel fortran2019+vs2015安装全记录
- 最新蓝屏代码0x0000006b完美解决方案,附文件
- C/C++语言 结构体数组初始化 结构体数组元素全部置0 memset函数将结构体数组初始化
- HTML Report报告无法正常展示的解决办法
- 程序性能常用衡量指标
- Centos配置Web Proxy(nginx)
- 阿里巴巴国际站店铺类目对运营的影响
- 小程序 | 优惠券样式
- wi ndows怎么自动编页,15个小技巧,让我的Windows电脑更好用了!
- 6 zabbix警报邮件发送配置
- vue美团电影模拟实现
- 当前发布的sku信息中包含疑似与商品无关的字段,请核实修改后重新提交
- Free Switch 端口配置
热门文章
- TVS二极管选型与参数,一看便知
- c++(十一)、运算符的重载
- 搞深度学习用什么笔记本最好?这份报告给你选出了性价比之王
- 基于R语言非参数统计Brown-Mood中位数检验和Wilcoxon-Mann-Whitney秩和检验
- 设置mysql事务隔离级别
- 怎么用matlab仿真新建,MatlabSimulink仿真的步骤.doc
- JAVA语言写的人工智能小实验——猴子摘香蕉
- steam创建账号一直验证人工操作_绝地求生轻量版即将登陆STEAM:预约送M416皮肤...
- 信息采集之微博热门自定以搜索
- php显示时间秒针走,Android_TextView显示系统时间(时钟功能带秒针变化,我们开启一个线程,线程每隔 - phpStudy...