错误信息

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的更多相关文章

  1. Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest

    情况是这样子的,导入一个比较老的项目(两年前),它依赖于一个 Libraray,已经先导入了 library,现在导入项目的时候出了错 (1) Android Studio 目前提供将 SDK包成 . ...

  2. android -------- 错误Attribute application@allowBackup value=(true) from AndroidManifest.xml

    开发中遇到一个问题,运行项目时,出现了一个这如下这样的问题 问题: Manifest merger failed : Attribute application@allowBackup value=( ...

  3. Flutter upgrade更新版本引发的无法启动调试APP的错误 target:kernel_snapshot failed”

    前言 我的主机上的Flutter 本地的分支是在 beta,因为去年想尝鲜Flutter Web,所以一直没切回来stable分支. 早上打开VSCode,右下角弹出了Flutter upgrade的 ...

  4. Attribute application@allowBackup value=(true) from AndroidManifest.xml:7:9-35

    1: 在 AndroidManifest.xml 配置文件中显式配置 android:allowBackup=false. 项目中代码 allowBackup="true" 改为 ...

  5. No resource identifier found for attribute 'showAsAction' in package 'android'

    运行一个项目时在一个menu.xml文件item属性android:showAsAction 报错 No resource identifier found for attribute 'showAs ...

  6. 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 ...

  7. Android:Attribute is missing the Android namespace prefix

    今天编写XML文件时,出现了Attribute is missing the Android namespace prefix的错误,开始一直找没找出原因,后来仔细一看原来只是一个很简单的单词书写错误 ...

  8. 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 ...

  9. Flutter Window环境运行(VSCode + 单独运行Android 虚拟机)

    官网以及很多网上文章的开发都是基于Android ,因为它能创建不同类型移动设备虚拟机.但个人始终觉得它太庞大,启动慢耗资源,但我们使用Flutter又离不开虚拟机. 经过实践,现在能成功的单独启动移 ...

随机推荐

  1. 泛微e-cology OA系统某接口存在数据库配置信息泄露漏洞复现

    1.简介(开场废话) 攻击者可通过存在漏洞的页面直接获取到数据库配置信息.如果攻击者可直接访问数据库,则可直接获取用户数据,甚至可以直接控制数据库服务器. 2.影响范围 漏洞涉及范围包括不限于8.0. ...

  2. The 2016 ACM-ICPC Asia China-Final D. Ice Cream Tower 二分 + 贪心

    题目大意: 对于给出的n个冰激凌球的大小,满足下面的球的大小是上一个的至少2倍,对于给出的k(由k的冰激凌球才能算作一个冰激凌塔),问n个冰激凌球可以最多堆出多少个高度为k的冰激凌塔 题目分析: 对于 ...

  3. 使用FileZilla快速搭建FTP文件服务

    为了便于平时对文件的存储访问,特意搭建FTP服务 FTP服务器(File Transfer Protocol Server)是在互联网上提供文件存储和访问服务的计算机,它们依照FTP协议提供服务. F ...

  4. 项目Beta冲刺(团队5/7)

    项目Beta冲刺(团队) --5/7 作业要求: 项目Beta冲刺(团队) 1.团队信息 团队名 :男上加男 成员信息 : 队员学号 队员姓名 个人博客地址 备注 221600427 Alicesft ...

  5. scala中可以执行外部命令Process

    后续用到在总结 Process(s"hadoop fs -rm -r ${path}").!!

  6. node 文件上传

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  7. 51nod1803 森林直径

    [传送门] 考虑计算直径的 dp 方法. $d[u]$ 表示以 $u$ 为根的子树能 $u$ 能走到的最远距离 $dp[u]$ 表示以 $u$ 为根的子树的直径那么每次dfs一个子节点后$dp[u] ...

  8. Sliding Window Median

    Description Given an array of n integer, and a moving window(size k), move the window at each iterat ...

  9. git 初始用法

    Git global setup git config --global user.name "xiaoming" git config --global user.email & ...

  10. 【牛客】路径计数机 (树形dp 前缀和)

    题目描述 有一棵n个点的树和两个整数p, q,求满足以下条件的四元组(a, b, c, d)的个数:  1.$1\leq a,b,c,d \leq n$  2.点a到点b的经过的边数为p.  3.点c ...