相关疑难解决方法(0)

appofonentFactory的Manifest Merger失败

使用Google所谓的Material Design 2.0需要您添加

implementation 'com.google.android.material:material:1.0.0-rc01'
Run Code Online (Sandbox Code Playgroud)

在应用程序Gradle中也包括

implementation 'com.android.support:appcompat-v7:28.0.0-rc02'    
Run Code Online (Sandbox Code Playgroud)

这显示了冲突

这是日志所说的内容

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0-rc02] AndroidManifest.xml:22:18-91   

is also present at [androidx.core:core:1.0.0-rc01] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).     Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override.
Run Code Online (Sandbox Code Playgroud)

即使在将其添加到Manifest之后,它也显示Manifest Merger因多次错误而失败

android manifest android-studio

27
推荐指数
4
解决办法
4万
查看次数

使用 groupid com.android.support 和 androidx.* 的依赖无法组合但找到了 IdeMavenCoordinates

我想升级 Google 图书馆:

build.gradle(应用程序):

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
    // Here an error appears.
    implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
    implementation "com.android.support:support-v4:${supportLibraryVersion}"
    implementation "com.android.support:design:${supportLibraryVersion}"
    implementation "com.android.support:support-vector-drawable:${supportLibraryVersion}"
    implementation "com.android.support:recyclerview-v7:${supportLibraryVersion}"
    implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation "com.android.support:support-compat:${supportLibraryVersion}"

    // These libraries are updated.

    // Google Maps.
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-location:17.0.0'

    implementation "com.google.firebase:firebase-messaging:19.0.1"
    implementation "com.google.android.gms:play-services-base:17.0.0"

    // Firebase.
    implementation 'com.google.firebase:firebase-config:18.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'

    // Multidex.
    implementation 'com.android.support:multidex:1.0.3'
}
Run Code Online (Sandbox Code Playgroud)

build.gradle(项目):

buildscript {
    ext.compile_sdk_version = 29
    ext.min_sdk_version = 16
    ext.target_sdk_version = 29
    ext.kotlin_version = '1.3.40'
    ext.supportLibraryVersion = …
Run Code Online (Sandbox Code Playgroud)

android androidx

12
推荐指数
0
解决办法
7747
查看次数

Gradle 错误:无法将文件转换为匹配属性 jetified

我已经建立了一个在 microsoft azure pipelines中运行我的测试的管道。在我的本地机器上,这工作正常,该jetified-libidpmobile-debug.jar文件位于我机器上的 gradle 系统目录中:

/Users/jimclermonts/.gradle/caches/transforms-2/files-2.1/efad9765ab457848824459e0c76abddc/jetified-libidpmobile-debug.jar
Run Code Online (Sandbox Code Playgroud)

这是我的build.gradle

debugImplementation files('libs/libidpmobile-debug.jar')
Run Code Online (Sandbox Code Playgroud)

据我了解,jetified-libidpmobile-debug.jar是由jetifierlibidpmobile-debug.jar文件中自动创建的。

输出:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> Could not resolve all files for configuration ':app:_classStructurekaptDebugKotlin'.
   > Failed to transform file 'jetified-libidpmobile-debug.jar' to match attributes {artifactType=class-structure, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
      > Execution failed for StructureArtifactTransform: /Users/iosadmin/.gradle/caches/transforms-2/files-2.1/1e14bb7ec832a0c2c967e6c977ddd9b9/jetified-libidpmobile-debug.jar.
         > error in opening zip file
Run Code Online (Sandbox Code Playgroud)

这是我的 azure-pipelines.yml 中组装调试和测试单元测试的部分:

trigger:
- master

pool: …
Run Code Online (Sandbox Code Playgroud)

android gradle azure-pipelines

5
推荐指数
1
解决办法
746
查看次数