当前位置: 首页 > 知识库问答 >
问题:

找到多个与操作系统无关的路径为“AndroidManifest.xml”的文件

淳于博
2023-03-14
Execution failed for task ':Android.OTT.Framework:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'AndroidManifest.xml'

以下是该模块的build.gradle:

buildscript {
    rootProject.ext {
        support_version = '28.0.0'
        retrofit_version = '2.6.0'
        kodein_version = '6.2.1'
        butterknife_version = '9.0.0'
        joda_time_version = '2.10.2'
        rxjava_version = '2.2.10'
        rxandroid_version = '2.1.1'
        nanohttpd_version = '2.3.1'
        gson_version = '2.8.5'
        okio_version = '2.2.2'
        annimon_stream_version = '1.2.1'
        leak_canary_version = '1.6.3'
        ok_http_version = '3.12.1'
        lifecycle_version = '1.1.1'

        mockito_version = '2.28.2'
        mockito_kotlin_version = '2.1.0'
        kluent_version = '1.41'
    }

    repositories {
        google()
        maven { url 'https://maven.fabric.io/public' }
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven { url 'https://plugins.gradle.org/m2/' }
    }

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.+'

        classpath "com.jakewharton:butterknife-gradle-plugin:$butterknife_version"
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
apply plugin: 'com.jakewharton.butterknife'

androidExtensions {
    experimental = true
}

repositories {
    google()
    maven { url 'https://maven.fabric.io/public' }
    mavenCentral()
    jcenter()
    maven { url "https://jitpack.io" }
    maven { url "https://dl.bintray.com/deltatre/exoplayer" }
}

allprojects {
    repositories {
        google()
        flatDir {
            dirs './divaLibs'
        }
        maven {
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
}

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            consumerProguardFiles 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }
    dataBinding {
        enabled = true
    }
}

realm {
    syncEnabled = true
}

dependencies {
    api project(':Android.OTT.OfflineVideo')
    api project(':Android.OTT.D3Foundation')

    // START DIVA PLAYER
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'divaLibs')
    api files('divaLibs/divaandroidlib-release-4.7.2.aar')
    implementation 'com.deltatre.android.exoplayer:exoplayer:2.9.5.1'
    implementation 'com.github.davibe:MD360Player4Android:dev-SNAPSHOT'
    implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.10.2'

    api "com.google.code.gson:gson:$gson_version"
    api "joda-time:joda-time:$joda_time_version" // needed also by Diva
    implementation 'com.google.android.gms:play-services-base:16.1.0'
    implementation 'com.google.android.gms:play-services-ads:17.2.1'
    implementation 'com.google.android.gms:play-services-analytics:16.0.8'
    implementation 'com.google.android.gms:play-services-cast:16.2.0'
    implementation 'com.google.android.gms:play-services-cast-framework:16.2.0'
    implementation files('divaLibs/comscore-3.1502.26.jar')
    implementation 'com.google.vr:sdk-videowidget:1.180.0'

    //Firebase
    api 'com.google.firebase:firebase-messaging:18.0.0'
    api 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.android.gms:play-services-tagmanager:16.0.8'
    // Urban Airship - FCM
    api 'com.urbanairship.android:urbanairship-fcm:10.0.2'
    // Support
    api "com.android.support:design:$support_version"
    api "com.android.support:cardview-v7:$support_version"
    api "com.android.support:recyclerview-v7:$support_version"
    api "com.android.support:support-v4:$support_version"
    api "com.android.support:mediarouter-v7:$support_version"
    api "com.android.support:appcompat-v7:$support_version"
    api "com.android.support:support-v13:$support_version"
    api "com.android.support:customtabs:$support_version"
    api 'com.android.support.constraint:constraint-layout:1.1.3'
    api 'com.android.support:multidex:1.0.3'

    implementation "android.arch.lifecycle:viewmodel:$lifecycle_version"
    implementation "android.arch.lifecycle:extensions:$lifecycle_version"

    // Analytics
    api('com.crashlytics.sdk.android:answers:1.4.7@aar') {
        transitive = true
    }
    api('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
        transitive = true
    }
    // Ui
    api 'me.relex:circleindicator:1.2.2@aar'
    api 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.afollestad.material-dialogs:core:0.9.5.0'
    // RETROFIT
    api "com.squareup.retrofit2:retrofit:$retrofit_version"
    api "com.squareup.retrofit2:converter-gson:$retrofit_version"
    api "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"
    // ok http
    implementation "com.squareup.okhttp3:okhttp:$ok_http_version"
    implementation "com.squareup.okhttp3:logging-interceptor:$ok_http_version"
    // Rx
    api "io.reactivex.rxjava2:rxandroid:$rxandroid_version"
    api "io.reactivex.rxjava2:rxjava:$rxjava_version"
    api 'com.jakewharton.rxbinding2:rxbinding:2.2.0'
    // IoC
    api "org.kodein.di:kodein-di-generic-jvm:$kodein_version"
    api "org.kodein.di:kodein-di-framework-android-support:$kodein_version"
    // Usefull
    api "com.annimon:stream:$annimon_stream_version"
    api "com.jakewharton:butterknife:$butterknife_version"
    kapt "com.jakewharton:butterknife-compiler:$butterknife_version"
    api 'com.jakewharton.timber:timber:4.7.1'
    implementation "com.squareup.okio:okio:$okio_version"
    implementation "org.nanohttpd:nanohttpd:$nanohttpd_version"
    implementation 'online.devliving:securedpreferencestore:0.7.4'
    api 'com.jakewharton:process-phoenix:2.0.0'

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    // TV
    api "com.android.support:leanback-v17:$support_version"

    // Leak Canary
    debugImplementation "com.squareup.leakcanary:leakcanary-android:$leak_canary_version"
    releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leak_canary_version"
    debugImplementation "com.squareup.leakcanary:leakcanary-support-fragment:$leak_canary_version"

    testImplementation 'junit:junit:4.12'
    testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockito_kotlin_version"
    testImplementation "org.mockito:mockito-inline:$mockito_version"
    testImplementation "org.amshove.kluent:kluent-android:$kluent_version"

    // Exomedia
    implementation 'com.devbrackets.android:exomedia:4.3.0'

    androidTestImplementation "org.mockito:mockito-android:$mockito_version"
}

以下是项目的build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        maven { url 'https://maven.fabric.io/public' }
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'io.realm:realm-gradle-plugin:5.11.0'
        classpath 'com.google.gms:google-services:4.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Android.ott.OfflineVideo模块的Build.Gradle:

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'

buildscript {
    rootProject.ext {
        jsoup_version = '1.12.1'
    }
}


android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            consumerProguardFiles 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

realm {
    syncEnabled = true
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "io.reactivex.rxjava2:rxjava:$rxjava_version"
    implementation "com.annimon:stream:$annimon_stream_version"
    implementation "com.google.code.gson:gson:$gson_version"
    implementation "org.nanohttpd:nanohttpd:$nanohttpd_version"
    implementation "org.jsoup:jsoup:$jsoup_version"
    implementation "joda-time:joda-time:$joda_time_version"
    implementation "com.android.support:support-annotations:$support_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            consumerProguardFiles 'proguard-rules.pro'
        }
    }
}

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

    implementation "com.android.support:support-annotations:28.0.0"//todo
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.amshove.kluent:kluent-android:1.41'
    testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
    testImplementation "org.mockito:mockito-inline:2.23.4"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
    mavenCentral()
}

我看到了很多像这样的问题。但我想这不是我的情况,因为我不能忽略androidmanifest.xml文件。提前道谢!

共有1个答案

东郭腾
2023-03-14

我在最后更新到AndroidX后收到了同样的错误。其他一些答案暗示我要将一些库恢复到它们上一个已知的工作版本。最重要的是android gradle插件。我有和你一样的版本:

类路径“com.android.tools.build:gradle:3.5.1”

我将其恢复到上一个已知的稳定版本,对我来说是3.4.0

因此,我建议您用较旧的android gradle插件解决问题,比如

类路径“com.android.tools.build:gradle:3.4.0”

然后在最终找到并修复问题后恢复(或保留旧的)。

 类似资料: