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

重复的罐子条目-Android

松和安
2023-03-14

我在构建过程中收到了这个警告。

警告:处理任务java时出现异常。伊奥。IOException:无法写入[/Users/petrose/as_projects/MrPhone/app/build/intermediates/transforms/proguard/debug/0.jar](无法读取[/Users/petrose/.gradle/caches/transforms-1/files-1.1/firebase-analytics-impl-16.2.4.aar/288ad7982e8f6024c8b5f0954f183721/jars/classes.jar(;;;;;**.class)](jar条目重复)[com/google/android/gms/internal/measurement/eo.class])

    apply plugin: 'com.android.application'
//apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'org.greenrobot.greendao'
//apply plugin: 'io.fabric'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    defaultConfig {
        applicationId "....."
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"


        vectorDrawables { useSupportLibrary = true }
        multiDexEnabled true
        resConfigs "en"

    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }



    buildTypes {
        release {
            minifyEnabled true
            useProguard true    // obfuscate
            shrinkResources true

        }

        debug {
            minifyEnabled true
            useProguard true    // obfuscate
            shrinkResources false
        }
    }

    packagingOptions {
        exclude 'META-INF/rxjava.properties'
    }
}

greendao {
    schemaVersion 1
}

dependencies {

    //extLib
    implementation files('libs/YouTubeAndroidPlayerApi.jar')

    //support Lib
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.android.support:recyclerview-v7:28.0.0"
    implementation "com.android.support:cardview-v7:28.0.0"
    implementation "com.android.support:design:28.0.0"
    implementation "com.android.support:support-vector-drawable:28.0.0"
    implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLibraryVersion"
    implementation "com.android.support:customtabs:28.0.0"



    //Google API Client Library
    implementation('com.google.apis:google-api-services-youtube:v3-rev195-1.23.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
        exclude group: 'com.google.guava'

    }
    implementation('com.google.api-client:google-api-client-android:1.23.0') {
        exclude group: 'org.apache.httpcomponents'
        exclude group: 'com.google.guava'

    }
//    implementation('com.google.apis:google-api-services-calendar:v3-rev309-1.23.0') {
//        exclude group: 'org.apache.httpcomponents'
//        exclude group: 'com.google.guava'
//
//    }

    // image
   //implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
//    implementation 'com.android.support:support-v4:27.1.1'
//    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    //annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
    implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion"
    implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2'
    implementation 'com.commit451:PhotoView:1.2.4'

    //Network
    implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
    implementation "com.squareup.retrofit2:retrofit:$rootProject.retorfitVersion"
    implementation 'com.squareup.retrofit2:converter-scalars:2.2.0'
    implementation "com.squareup.retrofit2:converter-gson:$rootProject.retorfitVersion"
    implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retorfitVersion"
    implementation 'org.jsoup:jsoup:1.10.3'

    // parser
    implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
    implementation 'com.fatboyindustrial.gson-jodatime-serialisers:gson-jodatime-serialisers:1.6.0'

    //parceler
    implementation 'org.parceler:parceler-api:1.1.12'
    annotationProcessor 'org.parceler:parceler:1.1.12'

    // database
    implementation "org.greenrobot:greendao:$rootProject.greenDaoVersion"
    debugImplementation "com.amitshekhar.android:debug-db:$rootProject.debugDBVersion"

    //eventBus
    implementation "org.greenrobot:eventbus:$rootProject.greenrobotVersion"

    //DI
    implementation "com.google.dagger:dagger-android:$rootProject.dagger2Version"
    annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
    implementation 'javax.inject:javax.inject:1'
    compileOnly 'javax.annotation:jsr250-api:1.0'

    // reactive
    implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
    implementation "com.github.miguelbcr:RxPaparazzo:$rootProject.rxRxPaparazzo"
    implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
    implementation "com.github.akarnokd:rxjava2-extensions:0.18.7"

    //butterknife
    implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
    annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"

    // logger
    implementation "com.jakewharton.timber:timber:$rootProject.timberVersion"
    implementation "com.github.nisrulz:easydeviceinfo-base:$rootProject.easyDeviceInfoVersion"
    implementation 'com.github.tslamic:dn3:3.0'

    //Firebase crash analytics
    //implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'

    // facebook sdk
   // implementation "com.facebook.android:facebook-android-sdk:$rootProject.facebookAndroidSDK"
   // implementation "com.facebook.android:audience-network-sdk:$rootProject.facebookNetworkSDK"
    implementation 'com.facebook.android:facebook-login:4.28.0'
    implementation 'com.facebook.android:audience-network-sdk:5.1.0-beta'

    // google sdk
    // implementation "com.google.android.gms:play-services-analytics:$rootProject.googleLibraryVersion"
    implementation('com.google.android.gms:play-services-analytics:16.0.4') {
        exclude group: 'com.google.guava'
    }
    implementation('com.google.android.gms:play-services-ads:17.0.0') {
        exclude group: 'com.google.guava'
    }
    implementation('com.google.android.gms:play-services-auth:16.0.0') {
        exclude group: 'com.google.guava'
    }
    implementation('com.google.android.gms:play-services-gcm:16.0.0') {
        exclude group: 'com.google.guava'
    }

    // fireBase libraries
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-config:16.1.3'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
    implementation 'com.google.firebase:firebase-appindexing:17.1.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    //implementation 'com.google.firebase:firebase-perf:16.2.3'
    //implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'


    //leak
    //debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    //releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'

    //testLib
    //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'

}
apply plugin: 'com.google.gms.google-services'
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '27.1.1'
            }
        }
    }
}

//顶级构建文件

buildscript {

    repositories {
        google()
        jcenter()
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
        classpath 'io.fabric.tools:gradle:1.27.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.google.com' }
    }
}

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

共有1个答案

邴修远
2023-03-14

在路径{module}/build/intermediates/transforms/proguard/debug/0处准备输出jar(0.jar)。jar,gradle复制所有依赖的库类。jar和其他依赖类。形成一个中间罐。因此,当两个不同的库依赖于单个模块时,单个模块会被复制两次,而这会导致此错误。

这可以通过在使用该模块的库中为单个模块标记compileOnly来解决。

 类似资料:
  • 我在Android Studio整天都在和这个错误作斗争。项目是从eclipse解决方案导入的。我一直试图实现所有的修复,列出了类似的帖子,没有任何工作。我是一个Android初学者。 我很乐意提供任何进一步的信息。

  • 我将 Digits 移动 sdk 集成到我的项目中,它不再构建。它与我正在使用的gson库有某种冲突。我在构建过程中收到此错误: 这是我的构建.

  • 问题内容: 这是我添加时开始的。尝试构建时出现此错误: 这是运行时输出的一部分: 我尝试将其添加到 我的 所有 依赖项中: 我试图将其添加到我的块: 这些变化: 这是 修复错误 之前的 尝试: 我搜索了我的项目,发现它仅在某些罐子中使用;,和。我试图将添加到那些相关的依赖项,但仍然看到相同的错误。 我在这里停留了太久了。有什么建议? 问题答案: 从播放服务相关的依赖项中排除。 例如: PS在出现错

  • 我有一个类,它将用一个数组中预先生成的所有员工填写一个列表。我可以用员工填充ArrayList,但唯一的问题是,我得到了一些“重复”条目,我使用引号是因为它们不完全相同,但它们可以共享相同的姓名或员工编号,但可能不具有相同的雇用年份或薪资等。 员工类别如下: 下面是将填充列表的generateList方法: “generateProductionWorker()和shiftSupervisor方法

  • 在一个带有远程显示API的Chromecast项目中,我发现“

  • 问题内容: 因此,当尝试向字段添加自动增量时,它会出现#1062-键1的重复条目‘1’。我尝试删除主键并重新添加它,效果很好(我认为如果有重复项,那不会吗?) 但是,当我尝试向字段添加自动增量时,会引发错误。它为我提供了一个浏览选项,该选项运行以下SQL: 但是,这将返回一个空结果集。表明没有重复项。因此,如果没有重复项,为什么不能添加自动增量? 问题答案: 您是否有任何具有值的行或该列的行?可能