1

I'm trying to import Facebook SDK 3.15.0 to Android Studio 0.6.1. I do follow Rani's explanation on using facebook sdk in android studio both for Android Studio earlier than 0.5.5 & the later one.

The error I get says something like this.

**Error:Execution failed for task ':app:processDebugResources'.

Error: A library uses the same package as this project: liquidcode.se.facebooktest You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0**

I also did include it in the setting.gradle & imported as module for the app.

I read now that many have the same problem, but how to fix it? Thank you.

Community
  • 1
  • 1
DMT82
  • 871
  • 2
  • 14
  • 32

2 Answers2

1

Delete the ApplicationId from your facebook sdk library build.gradle file. It should end up looking something like this.

//Wrong

      defaultConfig {
        applicationId "com.bz.buktest"
        minSdkVersion 10
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
       }

//Right

     defaultConfig {
         minSdkVersion 10
         targetSdkVersion 19
         versionCode 1
         versionName "1.0"
}

Done. Your problem should be solved. Hope you got it.

Naj
  • 723
  • 7
  • 17
0

I would start over, and add the project via the File -> Project Structure dialog. Mine worked with minimal additional effort after adding the sdk via the Project Structure dialog.

After adding via the Project Structure dialog, you need to change buildToolsVersion in Facebook's build.gradle file.

Also delete the component named FacetManager in Facebooks .iml file.

If you follow those three steps you should have Facebook's sdk properly integrated into your project.

Blake G
  • 581
  • 7
  • 24
  • I did what you wrote with your three steps but the first one didnt work. 1. File -> Import Module (the path to the facebook folder). 2. File -> Project Structure (import the module). 3. Open up the Facebook build.gradle change the builtToolsVersion and so on. 4. I even tried to delete the FacetManager from the component in Facebooks.iml file, but still, same error, so your steps didnt work. – DMT82 Jun 27 '14 at 06:23
  • Your path to the Facebook folder should be the inner folder labeled "facebook" within the "Facebook-android-sdk-XXX" folder. Make sure you linked to that folder. Additionally delete facet manager in the any and all .iml files within the project. – Blake G Jun 27 '14 at 12:28
  • Yes, i know which Facebook folder I need to choose. I see only facetManager in one place in the .iml file, but dont think thats the problem. I googled and saw that alot of other people do have the same problem. Do you use Android Studio 0.6.1 or earlier? Do you use Facebook-SDK-3.15.0 or earlier? Because that matters. The errormessage also said: android.enforceUniquePackageName=false. Where do I write that? With that written in the build.gradle, dont know where or which one, but that would help. – DMT82 Jun 27 '14 at 15:06