Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"could not find com_facebook_android.apk error" when running Android project

I've installed the Facebook API for Android in Eclipse, and imported the project into my Android project. My program builds perfectly fine, but when I try to run it I get

Could not find com_facebook_android.apk!

in the build window, and when the program actually tries to import any of the Facebook API classes it blows up with a java.lang.NoClassDefFoundError: com.facebook.android.Facebook

like image 236
Chris B. Avatar asked Dec 28 '22 14:12

Chris B.


1 Answers

Probably you added the reference to the Java project in the "Java Build Path" but it's the wrong place.

From the Android guide:

To add a reference to a library project, follow these steps:

  • In the Package Explorer, right-click the dependent project and select Properties.
  • In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
  • Click Add to open the Project Selection dialog.
  • From the list of available library projects, select a project and click OK.
  • When the dialog closes, click Apply in the Properties window.
  • Click OK to close the Properties window

This resolved my problem.

like image 188
alessio Avatar answered Mar 17 '23 03:03

alessio