程序类型已存在

时间:2018-06-13 09:08:59

标签: android android-studio

我遇到以下问题,但找不到任何解决方案:

enter image description here

Build.gradle:

apply plugin: 'com.android.application'

android {
    /*signingConfigs {
        config_release {
            keyAlias 'XXXXXXX'
            keyPassword XXXXXXX'
            storeFile file('C:/Users/...')
            storePassword 'XXXXXXX'
        }
    }*/
    compileSdkVersion  27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "XXXXXXX"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 126
        versionName "1.3.1"
        multiDexEnabled true
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            lintOptions {
                disable 'MissingTranslation'
            }
        }
    }
}

allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
    }
}

apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
    maven { url 'https://maven.google.com' } // necessary for Android API 26
    maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
    maven { url 'http://maven.gameanalytics.com/release' }
    maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
    maven { url "http://dl.appnext.com/" }
    maven { url "https://jitpack.io" }
    maven {
        name "Tapjoy's maven repo"
        url "https://tapjoy.bintray.com/maven"
    }
}

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:design:27.1.0'
    implementation project(':facebook-android-sdk-4.8.1')
    implementation files('libs/parse-android-1.13.1.jar')
    implementation files('libs/bolts-android-1.4.0.jar')
    implementation files('libs/bolts-tasks-1.4.0.jar')
    implementation project(':facebook-android-sdk-4.8.1')
    implementation files('libs/ParseFacebookUtilsV4-1.10.3.jar')
    implementation files('libs/greendao-1.3.7.jar')
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true
    }
    implementation('com.mopub:mopub-sdk:5.0.0@aar') {
        transitive = true
    }
    implementation 'com.thinkincode.utils:Android:0.1.8'
    implementation 'com.google.firebase:firebase-core:15.0.2'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-basement:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-base:15.0.1'
    implementation 'com.android.installreferrer:installreferrer:1.0'
    implementation 'com.github.Slyce-Inc:SlyceMessaging:1.1.2'
    implementation 'com.applovin:applovin-sdk:8.0.1'
    implementation 'com.mixpanel.android:mixpanel-android:5.0.0'
    implementation 'com.github.vungle:vungle-android-sdk:6.2.5'
    implementation files('libs/dagger-2.7.jar')
    implementation files('libs/javax.inject-1.jar')
    implementation(name: 'unity-ads', ext: 'aar')
    implementation 'com.gameanalytics.sdk:gameanalytics-android:3.4.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.facebook.android:audience-network-sdk:4.28.2'
    implementation 'com.ironsource.sdk:mediationsdk:6.7.9@jar'
    implementation(name: 'mopubadapters-release', ext: 'aar')
    implementation files('libs/AppTracker.jar')
    implementation files('libs/MoPubAppTracker.jar')
    implementation 'com.appnext.sdk.adapters:mopub-ads:2.+'
    implementation 'com.tapjoy:tapjoy-android-sdk:11.12.2@aar'
    implementation(name: 'adzone-android-core', ext: 'aar')
    implementation(name: 'adzone-android-mopub', ext: 'aar')
    implementation project(':tenjin')
    implementation project(':android-ad-sdk')
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.1.0'
            }
        }
    }
}

Build.gradle(项目):

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.3.1'

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

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

    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.+'
    }
}

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

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

我可以在模拟器上正常编译,但无法构建或生成签名的APK。

2 个答案:

答案 0 :(得分:0)

build.gradle

中添加此行

使用构建工具版本

 buildToolsVersion '27.1.1'

   implementation 'com.android.support:appcompat-v7:27.0.2'

如果需要,您可以将此代码合并到同一个

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.3.1'

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

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

    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.+'
    }
}

答案 1 :(得分:0)

升级到MoPub 5.1.0。 This was a conflict由于Proguard对分发给MoPub(com.mopub:mopub-sdk:5.0.0@aar)和千禧年(android-ad-sdk)的Moat SDK进行了模糊处理。