首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android未能合并Manifest文件

Android未能合并Manifest文件
EN

Stack Overflow用户
提问于 2019-09-26 10:54:22
回答 1查看 1.3K关注 0票数 1

我知道以前有人问过这类问题,但这些答案并没有解决我的问题。今天,我在我的应用程序中添加了一个新版本的PayU Money,它突然显示出一个错误。我已经将整个项目转换为androidx,同样的错误也出现了。

属性应用@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from androidx.core:core:1.0.0 AndroidManifest.xml:22:18-86也出现在com.android.Support:support:28.0.0 AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).上建议:在AndroidManifest.xml:31:5-163:19的元素中添加‘tools:replace=:appComponentFactory’来覆盖。

如果我在报表文件中添加了这个tools:replace="android:appComponentFactory,它将显示新的错误

报表合并失败,多个错误,请参阅日志

关于检查合并清单,它显示

合并错误:错误:工具:替换在行中指定的属性android:appComponentFactory,但没有指定新的值指定的应用程序主清单(此文件),第30行错误:验证失败,退出应用程序主清单(此文件)

我找不出这个错误。这是build.gradle(app)

代码语言:javascript
复制
buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
  }
}
 apply plugin: 'com.android.application'
 apply plugin: 'io.fabric'

 android {
compileSdkVersion 28

defaultConfig {
    applicationId "com.packagename"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 54
    versionName "5.4"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
    multiDexEnabled true
    ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'

}
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
lintOptions {
    checkReleaseBuilds false
    abortOnError false
}
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/NOTICE'
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}
 repositories {
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
maven {
    url "https://oss.sonatype.org/content/repositories/snapshots"
  }
 }

 dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.volley:volley:1.1.1'

implementation 'com.google.android.gms:play-services-identity:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-perf:19.0.0'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'

implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true;
}
implementation 'com.google.code.gson:gson:2.8.2'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
implementation 'com.facebook.android:facebook-android-sdk:4.22.0'
implementation 'com.wefika:flowlayout:0.4.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation project(':sdkui')
implementation 'com.android.support:design:28.0.0'
implementation 'com.zopim.android:sdk:1.4.2'

/* Snappydb (cache/db) */

/*For shimmer effect*/
implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'com.snappydb:snappydb-lib:0.5.2'

   }
    apply plugin: 'com.google.gms.google-services'

请帮我解决这个问题

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-09-26 10:56:16

在清单的<application />标记中添加这2行

代码语言:javascript
复制
   tools:replace="android:appComponentFactory"
   android:appComponentFactory="whateverString"

这对我有帮助。希望这也能帮到你。

您应该试一次,。您还需要添加这一行。

代码语言:javascript
复制
android:appComponentFactory="whateverString"

对于GoogleAPIClient不对称,您应该在您的AppCompactActivity中使用以下内容:

代码语言:javascript
复制
 mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(LocationServices.API)
                .build();

remove enableAutoManage() enableAutoManage()需要一个FragmentActivity或其中的某个子类,例如AppCompatActivity。不能在常规活动中使用enableAutoManage()。以下任一项:

enableAutoManage()

  • 将代码转换为使用FragmentActivityAppCompatActivity,或者

  • 不调用FragmentActivity
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58115261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档