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

DMT82 picture DMT82 · Jul 15, 2014 · Viewed 18.9k times · Source

This is the error-message I get after that I imported the Facebook SDK (3.15.0) into Android Studio (0.8.2).

Error:Execution failed for task ':app:processDebugResources'. Error: A library uses the same package as this project: com.aaa.bbb.test You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0

This is mine build.gradle.

apply plugin: 'com.android.application'

android {
compileSdkVersion 19
buildToolsVersion '19.1.0'

defaultConfig {
    applicationId "com.aaa.bbb.test"
    minSdkVersion 11
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19+'
compile project(':facebook')

}

And this is mine Facebook build.gradle.

apply plugin: 'com.android.library'

dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/bolts.jar')
}

android {
compileSdkVersion 19
buildToolsVersion '19.1.0'

defaultConfig {
    applicationId "com.aaa.bbb.test"
    minSdkVersion 11
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}

lintOptions {
    abortOnError false
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        res.srcDirs = ['res']
    }
}
}

I don't find two of the same packages, or I maybe looking on wrong places. Can someone tell me what it could be? Thank you.

Answer

Damian Jeżewski picture Damian Jeżewski · Jul 15, 2014

Have you tried changing/removing duplicated applicationId from the defaultConfig in library's build.gradle? That should resolve your issue.