找到了多个独立的os路径 [英] More than one independant os path found

查看:73
本文介绍了找到了多个独立的os路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行我的应用时遇到此错误:

找到了多个与OS无关的路径'META-INF / INDEX.LIST'的文件



有人可以帮帮我吗?

谢谢。



我尝试过什么:



 //项目gradle 
buildscript {

repositories {
google()
jcenter()
}
依赖关系{
classpath'com.android.tools.build:gradle:3.1.1'
classpath'com。 jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
classpath'com.github.dcendents:android-maven-gradle-plugin:1.4.1'


//注意:不要在此处放置应用程序依赖项;它们在单个模块build.gradle文件中属于
//
}
}

allprojects {
repositories {
google()
jcenter()
}
}

任务清理(类型:删除){
delete rootProject.buildDir
}
/ / app gradle
apply plugin:'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationIdcom.example.rogx10.gps
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFil es getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
packagingOptions {
不包括'META-INF / DEPENDENCIES'
排除'META-INF / LICENSE'
排除'META-INF / LICENSE.txt'
排除'META-INF / license.txt'
排除'META-INF / NOTICE'
排除'META-INF / NOTICE.txt'
排除'META-INF / notice.txt'
排除'META-INF / ASL2.0'
}
}

依赖项{
编译fileTree(dir:'libs',包含:'[*。jar]')
androidTestCompile('com.android.support.test.espresso) :espresso-core:2.2.2',{
排除组:'com.android.support',模块:'support-annotations'
})
编译'io.paperdb:paperdb :2.5'
compile'c​​om.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(dir:'libs',include:['* .jar'])
实现'com.android.support:appcompat-v7:27.1.1'
implementation'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation'junit:junit:4.12 '
androidTestImplementation'com.android.support.test:runner:1.0.1'
androidTestImplementation'com.android.support.test.espresso:espresso-core:3.0.1'
compile project(':mysql-connector-java-5.1.46-bin')
}

解决方案

我google了错误一次,发现可能的解决方案:

android - On gradle:3.0.0在OS独立路径中发现了多个文件' META-INF / ASL2.0' - 堆栈溢出 [ ^ ]

I am getting this error when running my app:

More than one file was found with OS independent path 'META-INF/INDEX.LIST'


Can someone please help me?
Thanks.

What I have tried:

//Project gradle
buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
//app gradle
apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.rogx10.gps"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions{
            annotationProcessorOptions{
                includeCompileClasspath = true
            }
        }
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
}

dependencies {
    compile fileTree(dir:'libs',include:'[*.jar]')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',{
        exclude group:'com.android.support',module:'support-annotations'
    })
    compile 'io.paperdb:paperdb:2.5'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile project(':mysql-connector-java-5.1.46-bin')
}

解决方案

I googled the error once and found the likely resolution:
android - On gradle:3.0.0 More than one file was found with OS independent path 'META-INF/ASL2.0' - Stack Overflow[^]


这篇关于找到了多个独立的os路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆