Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Facebook dependency in offline mode on Android Studio

I am trying to write a program that can make Facebook updates but i have issues adding the Facebook dependency. I already have the sdk but couldn't add to my project because... Err even though i have tried adding the gradle.prperties file to the extracted Facebook folder as a comment suggested here

Next i tried adding as suggested on the Facebook official page but i hit this snag...Err2

Now, because if the price of data where I'm from, I'd rather not go online since I already have the sdk locally so my question is how can i manually cache the sdk into my project?

EDIT: For clarity, my question is HOW DO I ADD THE FACEBOOK SDK INTO MY PROJECT WITHOUT GOING ONLINE (i.e. OFFLINE BUILD)?

like image 418
kbluue Avatar asked Jun 27 '17 14:06

kbluue


2 Answers

Download Facebook Android SDK 4.24.0 ARR it from here

Then, In order to import a .aar library:

  1. Add a .aar file in libs folder.
  2. Use "New Module" option under File menu.
  3. Import the .aar file.
  4. Build gradle and compile the project.
like image 71
ZeroOne Avatar answered Oct 31 '22 21:10

ZeroOne


From my experience, all you need to do is set android studio's offline compile option and build it once. After that, you can re-build as much as you can without going online.

Here is a link on setting the offline option. Hope it helps: https://hackernoon.com/speed-up-gradle-build-in-android-studio-80a5f74ac9ed?gi=2bb71fe06274

like image 32
Mohammed Avatar answered Oct 31 '22 20:10

Mohammed