0

I keep getting

Error:Execution failed for task ':streamHdtv2:processDebugResources'.
> Error: more than one library with package name 'com.facebook'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0

error. I have checked my build.gradle several times but I couldnt find any duplicate entry for package Facebook.

My build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.flashlight"
        minSdkVersion 15
        targetSdkVersion 21
    }

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

dependencies {
    compile project(':initActivity')
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile project(':facebook')
}
Kevin S
  • 11
  • 7

3 Answers3

1

You are importing one library twice

 compile 'com.facebook.android:facebook-android-sdk:4.6.0'
 compile project(':facebook')

So remove one of the line and it will work.

and for more information have a look at below link

A library uses the same package as this project after importing Facebook SDK

Community
  • 1
  • 1
Moubeen Farooq Khan
  • 2,875
  • 1
  • 11
  • 26
0
 compile 'com.facebook.android:facebook-android-sdk:4.6.0'
 compile project(':facebook')

Comment out any of the above line.

Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107
0

Use this

Error:Execution failed for task ':streamHdtv2:processDebugResources'.
> Error: more than one library with package name 'com.facebook'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
error. I have checked my build.gradle several times but I couldnt find any duplicate entry for package Facebook.

My build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.flashlight"
        minSdkVersion 15
        targetSdkVersion 21
    }

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

dependencies {
    compile project(':initActivity')
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}
Faiyaz
  • 574
  • 1
  • 9
  • 39