工具:替换在第 19 行为属性 android:appComponentFactory 指定的替换,但没有指定应用程序主清单的新值

Tec*_*evs 5 java sdk android

我正在尝试编译 6 个月前的代码,但出现此错误:

tools:replace specified at line:19 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 18 Error: Validation failed, exiting app main manifest (this file)

为了解决这个问题,我在我的 AndroidManifest.xml

tools:replace="android:appComponentFactory"
Run Code Online (Sandbox Code Playgroud)

但现在我收到了这个错误:

Manifest merger failed with multiple errors, see logs

当我用谷歌搜索这个错误时,它要求我从AndroidManifest.xml我在第一步添加的行中删除该行。所以,这是一种循环。我怎样才能摆脱这个。

我的依赖:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation files('libs/apache-mime4j-0.6 2.jar')
implementation files('libs/httpmime-4.0.1 .jar')
// this line must be included to integrate with Firebase
implementation 'com.hbb20:ccp:2.0.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.17'
implementation 'com.github.mukeshsolanki:country-picker-android:1.1.9'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.google.maps.android:android-maps-utils:0.4'
implementation 'com.google.android.gms:play-services-location:10.2.1'
implementation 'com.google.code.gson:gson:2.4'
implementation 'com.airbnb.android:airmapview:1.3.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.jd-alexander:library:1.1.0'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-maps:10.2.1'
implementation 'com.google.android.gms:play-services-wallet:10.2.1'
implementation 'com.stripe:stripe-android:4.1.5'
implementation 'com.stripe:stripe-java:1.47.0'
implementation 'com.squareup.picasso:picasso:2.4.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.google.firebase:firebase-core:10.2.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
implementation 'com.google.firebase:firebase-database:10.2.1'
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
testImplementation 'junit:junit:4.12'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.1'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:mediarouter-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
Run Code Online (Sandbox Code Playgroud)

}

and*_*her 5

似乎您的项目中的另一个清单文件存在合并问题。许多元素名称可以在清单中出现多次,例如多个<uses-permission>元素。其中许多都有一个标识符,通常是android:name,可以将其中一个与下一个区分开来。一般来说,如果两个清单源都提供相同的元素(即相同的元素名称、相同的 android:name 值),则这两个元素本身会合并,这意味着:

  • 一个元素中存在的任何属性(而不是另一个元素中的属性)都会添加到组合元素中。
  • 两者中存在且值不相同的任何属性都会导致合并冲突编译错误,除非通过标记指定解决方案
  • 应用相同的规则,合并所有子元素(例如, 内部)。

有时,默认的合并规则并不能让您满意。特别是,当存在冲突时,构建将会失败,这可能不是期望的结果。要声明在冲突情况下谁获胜,您可以tools:* attributes在清单元素中使用。具体来说:

  • tools:node指示如何解决此特定 XML 元素的两个版本之间的冲突(例如,针对相同的 android:name)
  • tools:replace指示清单的较低优先级版本中的某些属性应被清单的较高优先级版本中的替换值覆盖
  • tools:remove指示应完全删除清单的较低优先级版本中的某些属性

xmlns:tools="http://schemas.android.com/tools"其中每一个都位于工具名称空间中,如果根元素尚不存在,则需要您拥有它。这些属性仅影响构建工具,除了构建工具如何基于工具属性构建应用程序之外,没有运行时影响。