1

I would like to start a project in Android Studio, using Simple Facebook library. I used to develop in Eclipse and things were fine, but now i had to face an issue while trying to make the libraries work with gradle.

  1. I made a new project.
  2. I made a module for official Facebook SDK inside "libraries" folder
  3. I made a module for Simple Facebook library inside "libraries" folder

I got the following error:

Error:A problem occurred configuring project ':app'.
> Cannot evaluate module simplefacebook : Configuration with name 'default' not found.

I did my research and as everybody experienced this error message is not really informative, and i also tryed to solve this problem from stack overflow's other smiliar questions but just coudnt get it work.

Please help if you can.

And please mention in comment which gradle file you would like to see, because there are 5 of them.

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222

1 Answers1

1

Look in the docs from Facebook!

You don't need to place the hole project as library module anymore in android studio.

Facebook and many other API Providers provide ther Libs now over Maven and you only have to add the dependcy to the correct artifact in your apps build.gradle file.

Here example for Facebook SDK:

dependencies { 
  compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}

Copied from here: https://developers.facebook.com/docs/android/getting-started

I havn't searched for the other lib, but you should find it your self on developers.facebook.com.

Rene M.
  • 2,660
  • 15
  • 24
  • Made a new project, added the dependency, got error: `Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher com_facebook_tooltip_black_bottomnub.png failed, see logs` How does a must-be-simple-and-usable system, which one is made for helping and fastening developers work is so unusable? Im not asking to build a time machine, i simply want to add a library to a blank, new project. I miss the old "import new project" Eclipse days. – Adam Varhegyi May 19 '15 at 15:04
  • did you followed the instructions on the get starting guide? I haven't used Facebook SDK so I have no experience with it. All other libs I used over maven worked out of the box perfectly. Strange. The error is talking about missing resource, probaly you have access rights problems in your working dir? Because gradle will first extract the aar into your app module and is then merging it with it, this seams to be failed for you. – Rene M. May 19 '15 at 15:07
  • 1
    changed `classpath 'com.android.tools.build:gradle:1.1.0'` to `classpath 'com.android.tools.build:gradle:1.1.3'` and now the error is gone, dont ask me why – Adam Varhegyi May 19 '15 at 15:26
  • One way or another it is working now, so i accepted your answer. – Adam Varhegyi May 19 '15 at 15:43
  • Thank you vers very much – Rene M. May 19 '15 at 15:45