Cocos 2d-x java.util.zip.ZipException:重复条目:android / support / annotation / RequiresPermission $ Write.class

时间:2019-05-27 10:01:44

标签: java android

我正在尝试运行旧的源代码(cocos2dx项目)。

我知道在此论坛上曾有人问过这个问题,并且我检查并尝试了我可以用google搜索的几乎所有解决方案,但是我找不到任何冲突的文件:

这是我收到的错误消息:

  
    

:SudokuFree:packageAllDebugClassesForMultiDex失败:SudokuFree:packageAllDebugClassesForMultiDex(线程[任务     worker,5,main])完成。花了0.951秒。

  
     

失败:构建失败,并出现异常。

     
      
  • 出了什么问题:任务':SudokuFree:packageAllDebugClassesForMultiDex'的执行失败。      
        

    java.util.zip.ZipException:重复项:android / support / annotation / RequiresPermission $ Write.class

      
  •   

我也关注了this中篇文章,但找不到任何重复的dep

这是我的build.gradle:

`apply plugin: 'com.android.application'

repositories {
    flatDir {
      dirs 'libs'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    // not having the below line results in errors like "org.apache.http does not exist"
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "air.com.tectum.sudoku"
        multiDexEnabled true
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1000159
        versionName "4.4.2"
        manifestPlaceholders = [HOCKEYAPP_APP_ID: "b1f9d21e9ee348618d2894b8f0da7271"]
    }

    dexOptions {
        incremental false
        javaMaxHeapSize "4g"
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
    }

    sourceSets.main {
        java.srcDir "src"
        res.srcDir "res"
        jniLibs.srcDir "libs"
        manifest.srcFile "AndroidManifest.xml"
        assets.srcDir "assets"
    }

    signingConfigs {

       release {
            if (project.hasProperty("RELEASE_STORE_FILE")) {
                storeFile file(RELEASE_STORE_FILE)
                storePassword RELEASE_STORE_PASSWORD
                keyAlias RELEASE_KEY_ALIAS
                keyPassword RELEASE_KEY_PASSWORD
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            if (project.hasProperty("RELEASE_STORE_FILE")) {
                signingConfig signingConfigs.release
            }
            ndk {
                abiFilters "armeabi"
            }
        }
        releaseUnsigned.initWith(buildTypes.release)
        releaseUnsigned {
            signingConfig null
        }
        debug {
            ndk {
                abiFilters "armeabi"
            }
        }
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    //compile fileTree(dir: 'libs', include: ['*.jar'])
    //compile project(':libcocos2dx')

    if (!project.hasProperty('appcompat_library_version')) {
        ext.appcompat_library_version = '23.4.0'
    }
    if (!project.hasProperty('support_library_version')) {
        ext.support_library_version = '23.4.0'
    }
    if (!project.hasProperty('gms_library_version')) {
        ext.gms_library_version = '9.0.0'
    }
    //compile "com.android.support:appcompat-v7:${appcompat_library_version}"
    //compile "com.android.support:support-v4:${support_library_version}"
    //    compile "com.google.android.gms:play-services-analytics:${gms_library_version}"
    compile "com.google.android.gms:play-services-ads:${gms_library_version}"

    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':libcocos2dx')
    compile 'net.hockeyapp.android:HockeySDK:4.0.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.google.android.gms:play-services-appindexing:9.0.0'
    compile 'com.google.android.gms:play-services-games:9.0.0'
    compile project(':BaseGameUtils')
    compile 'commons-net:commons-net:3.6'//{ exclude module: 'org/apache/common/net/finger/FingerClient.class' }
    //compile files('libs/android-support-v7-recyclerview-23.1.1.jar')
    compile files('libs/appodeal-2.4.10.jar')
    compile files('libs/applovin-8.0.2.jar')
    compile files('libs/chartboost-7.2.0.jar')
    compile files('libs/flurry-analytics-7.0.0.jar')
    compile files('libs/amazon_ads-5.9.0.jar')
    compile files('libs/mailru-5.1.0.jar')
    compile files('libs/startapp-3.9.3.jar')
    compile files('libs/unity_ads-2.2.1.jar')
    compile files('libs/yandex-metrica-3.2.2.jar')
    compile files('libs/inmobi-7.1.1.jar')
    compile files('libs/yandex-mobileads-2.75.jar')
    compile files('libs/mopub-sdk-5.1.0.jar')
    compile files('libs/mopub-sdk-banner-5.1.0.jar')
    compile files('libs/mopub-sdk-base-5.1.0.jar')
    compile files('libs/mopub-sdk-interstitial-5.1.0.jar')
    compile files('libs/mopub-sdk-native-static-5.1.0.jar')
    compile files('libs/mopub-sdk-rewardedvideo-5.1.0.jar')
    compile files('libs/mopub-volley-2.0.0.jar')
    compile files('libs/facebook-5.1.0.jar')
    compile files('libs/vungle-6.3.12.jar')
    compile(name: 'adcolony-3.3.4', ext: 'aar')
    compile(name: 'mobvista-9.0.0-alphab', ext: 'aar')
    compile(name: 'mobvista-9.0.0-common', ext: 'aar')
    compile(name: 'mobvista-9.0.0-interstitial', ext: 'aar')
    compile(name: 'mobvista-9.0.0-interstitialvideo', ext: 'aar')
    compile(name: 'mobvista-9.0.0-mtgdownloads', ext: 'aar')
    compile(name: 'mobvista-9.0.0-mtgjscommon', ext: 'aar')
    compile(name: 'mobvista-9.0.0-mtgnative', ext: 'aar')
    compile(name: 'mobvista-9.0.0-nativeex', ext: 'aar')
    compile(name: 'mobvista-9.0.0-playercommon', ext: 'aar')
    compile(name: 'mobvista-9.0.0-reward', ext: 'aar')
    compile(name: 'mobvista-9.0.0-videocommon', ext: 'aar')
    compile(name: 'mobvista-9.0.0-videojs', ext: 'aar')
    compile(name: 'ogury-3.0.13', ext: 'aar')

}
dependencies { compile 'com.facebook.android:facebook-android-sdk:[4,5)' }`

0 个答案:

没有答案