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又离不开虚拟机. 经过实践,现在能成功的单独启动移 ...
随机推荐
- Mac安装vscode IDE 撸nodejs代码
1. vscode官网地址:https://code.visualstudio.com 找到mac对应的下载地址,下载后的文件是 zip压缩包,解压后将文件拖到Application目录下即可. ...
- Linux之ubuntu下载
(转载) ubuntu 16.04国内下载地址: 中科大源 http://mirrors.ustc.edu.cn/ubuntu-releases/16.04/ 阿里云开源镜像站 http://mirr ...
- zabbix4.0自动发现主机
一.自动发现主机的需求 由于机房设备拆分,迁移服务器后,原来的监控失效.再重新搭建监控平台后,批量主机手动添加真的是很麻烦. 所以就用到了zabbix的自动发现功能 二.配置自动发现服务 配置--&g ...
- MGR基本使用(转)
第一章:MGR介绍 MGR(MySQL Group Replication)是一个MySQL Server插件,可用于创建弹性,高可用MySQL集群方案.有一个内置的组成员服务,在任何给定的时间点,保 ...
- 石子合并问题--直线版 HRBUST - 1818
t题目链接:https://vjudge.net/problem/HRBUST-1818 思路:一段已经合并的区间,分成两段区间,遍历所有能分开的区间. 代码有注释,基本就这样一个简单是思路. #in ...
- Linux下如何退出vim的一些常用命令总结
1.保存并退出 linux下安装好了vim以及gcc后,我们开始新建一个c文件,例如: vim test.c 之后进入vim的编辑框中,点击i进入插入模式,开始编辑程序,当你编写好自己的程序之后,按E ...
- Java Mail 异常
Java Mail 异常 java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream 解决方案: 把Jar包换一个比较高的版本就 ...
- 01_搭建基本的FTP服务器(数通华为)
1.选择客户端和服务端: 2.FTP服务端配置设置待FTP的文件: 3.客户端配置访问: 4.双击下载到本地:
- 如何安全地使用redis的pop命令
Redis的list经常被当作队列使用,左进右出,一般生产者使用lpush压入数据,消费者调用rpop取出数据. 这是很自然的行为,然而有时会发现lpush成功,但rpop并没有取到数据,特别是一些客 ...
- Ubuntu 下安装 Qt Designer
1. apt-get install qt5-designer 2.终端下输入designer,显示: designer: could not exec '/usr/lib/x86_64-linux- ...