0

Getting this error while trying to run my app - Program type already present: android.support.v4.app.BackStackRecord$Op

I have gone through the post - Program type already present: android.support.v4.app.BackStackRecord but still couldn't figure out the problem , below is my gradle file for reference -

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.google"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"

        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.android.gms:play-services:9.4.0'
//    // retrofit, gson
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.squareup.retrofit2:retrofit:2.0.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.2'

}
user3805333
  • 106
  • 3
  • 1
    add your project level gradle file code. –  Jun 18 '18 at 06:17
  • which line to getting error show full error code –  Jun 18 '18 at 06:21
  • Possible duplicate of [Program type already present: android.support.v4.app.BackStackRecord](https://stackoverflow.com/questions/49837344/program-type-already-present-android-support-v4-app-backstackrecord) – InsaneCat Jun 18 '18 at 06:34

2 Answers2

0

Try changing apply plugin: 'com.android.application' and/or applicationId "com.google"

Maksym V.
  • 2,877
  • 17
  • 27
0

Check your project level gradle file like below..

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

buildscript {
    ext.kotlin_version = '1.2.41'

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // 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
}

also try to check this line.

implementation 'com.android.support:appcompat-v7:27.0.2'
Axe
  • 6,285
  • 3
  • 31
  • 38