flutter upgrade之后出现Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from
错误信息
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
/Users/LinkinStar/flutterProject/xxxxxxxxx/android/app/src/debug/AndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:11:5-34:19 to override.
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:11:5-34:19 to override.
我判断问题是由于AndroidX和Android support 共存导致
在更新一些依赖之后出现
Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
最终解决
在build.gradle文件中添加
中间subprojects这一段
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
}
}
参考:https://github.com/flutter/flutter/issues/27254
作者:LinkinStar
未经允许,不得转载
flutter upgrade之后出现Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from的更多相关文章
- Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest
情况是这样子的,导入一个比较老的项目(两年前),它依赖于一个 Libraray,已经先导入了 library,现在导入项目的时候出了错 (1) Android Studio 目前提供将 SDK包成 . ...
- android -------- 错误Attribute application@allowBackup value=(true) from AndroidManifest.xml
开发中遇到一个问题,运行项目时,出现了一个这如下这样的问题 问题: Manifest merger failed : Attribute application@allowBackup value=( ...
- Flutter upgrade更新版本引发的无法启动调试APP的错误 target:kernel_snapshot failed”
前言 我的主机上的Flutter 本地的分支是在 beta,因为去年想尝鲜Flutter Web,所以一直没切回来stable分支. 早上打开VSCode,右下角弹出了Flutter upgrade的 ...
- Attribute application@allowBackup value=(true) from AndroidManifest.xml:7:9-35
1: 在 AndroidManifest.xml 配置文件中显式配置 android:allowBackup=false. 项目中代码 allowBackup="true" 改为 ...
- No resource identifier found for attribute 'showAsAction' in package 'android'
运行一个项目时在一个menu.xml文件item属性android:showAsAction 报错 No resource identifier found for attribute 'showAs ...
- Error:(108) No resource identifier found for attribute 'style' in package 'android'
Error:(108) No resource identifier found for attribute 'style' in package 'android' 解决方案: 这是错误的写法: a ...
- Android:Attribute is missing the Android namespace prefix
今天编写XML文件时,出现了Attribute is missing the Android namespace prefix的错误,开始一直找没找出原因,后来仔细一看原来只是一个很简单的单词书写错误 ...
- Attribute meta-data#android.support.VERSION@value value=(25.4.0) from AndroidManifest.xml:25:13-35 is also present at AndroidManifest.xml:28:13-35 value=(26.1.0).
Android Studio 编译项目的时候报错 Merging Errors: Error: Attribute meta-data#android.support.VERSION@value va ...
- Flutter Window环境运行(VSCode + 单独运行Android 虚拟机)
官网以及很多网上文章的开发都是基于Android ,因为它能创建不同类型移动设备虚拟机.但个人始终觉得它太庞大,启动慢耗资源,但我们使用Flutter又离不开虚拟机. 经过实践,现在能成功的单独启动移 ...
随机推荐
- Dockerfile(从无到有创建镜像)
本文原始地址:https://sitoi.cn/posts/43818.html 结构 DockerFile分为四部分组成: 基础镜像信息 维护者信息 镜像操作指令 容器启动时执行指令 基础镜像信息 ...
- 2019年杭电多校第一场 1009题String(HDU6586+模拟+单调栈)
题目链接 传送门 题意 给你一个字符串,要你构造一个长为\(k\)的子串使得每个字母出现的次数在\([L_i,R_i](0\leq i\leq26)\)间且字典序最小. 思路 做这种题目就是要保持思路 ...
- MySQL定义char和varchar类型,utf8编码,则最大值为多少?
有道面试题:若一张表中只有一个字段VARCHAR(N)类型,utf8编码,则N最大值为多少?先明白计算的一些规则限制 4.0版本以下,varchar(20),指的是20字节,如果存放UTF8汉字时,只 ...
- 洛谷【P1498】:南蛮图腾(分治算法)
传送门 题目描述就不用看了,直接上样例就行: 输入样例#1: 2 输出样例#1: /\ /__\ /\ /\ /__\/__\ 输入样例#2: 3 输出样例#2: /\ /__\ /\ /\ /__\ ...
- 用户体验报告(Echo)
班级:软件工程1916|W 作业:项目Beta冲刺(团队) 团队名称:Echo 团队博客汇总 队员学号 队员姓名 个人博客地址 备注 221600136 张至锋 https://www.cnblogs ...
- test20191020 往复
往复 Coldhac 做不出题了,他在长为 n 的走廊里走来走去.从位置 1 开始, 每次他会向前走长为 i ∈ [1, k] 的一步(不能超出走廊的范围),直至到达位 置 n. 在想出正解前,Col ...
- 一个使用vue和echarts结合的demo
前端框架真的很神奇,接触了几天vue.js,用它结合echarts做一个数据分析图,效果如下: 附上源码地址:https://github.com/qingguoYan/orderVue.git
- 解决在IDEA中无法使用Scanner输入的问题
今天写了一段代码用来测试输入,发现不管怎么样搜无法输入数据,代码如下: @Testpublic void func01(){ Scanner scanner = new Scanner(System. ...
- Mysql命令下导出select查询数据之 select ... into outfile方法
Mysql日常使用中经常遇到将select查询的数据导出到本地目录的情况,以便数据备份.分析等. 接下来将介绍Mysql终端下使用 select ... into outfile 语句导出数据方法 命 ...
- 为什么学习JavaScript设计模式,因为它是核心
那么什么是设计模式呢?当我们在玩游戏的时候,我们会去追求如何最快地通过,去追求获得已什么高效率的操作获得最好的奖品:下班回家,我们打开手机app查询最便捷的路线去坐车:叫外卖时候,也会找附近最近又实惠 ...