Android Facebook SDK no class def found com.facebook.android.Facebook - java

I'm using a version of the Facebook SDK, I'm not sure which version as I was given the eclipse project and told to use it but it was given to me before SDK 3.0 was released, so most likely 2.0, in an Android app. The app's project has the SDK project listed as a required project to enable us to prompt for Facebook login within the app.
I've tried telling eclipse to export the project with or without the Facebook project but it makes no difference.
I have also tried running the app both with and without the official Facebook app installed.
Every time I try to initiate the login for Facebook, I get the message:
01-24 19:05:11.863: E/AndroidRuntime(12697): Caused by: java.lang.NoClassDefFoundError: com.facebook.android.Facebook
Any help or insight is greatly appreciated.

As it turns out, one of my team-mates loaded up the project from Git, compiled it, and ran it with no changes and it works just fine. Clearly something is messed up with my setup somewhere whether it is with the Facebook SDK or Eclipse. I'm running Eclipse Juno, he is running Eclipse Indigo.
This turned out to be because I hadn't included the library project in the "Android" section of the project's properties.

Related

How do I fix the Android Studio error: "Cannot start uploading: The tools sdk jar could not be located." in Android Studio?

Recently, I have found an interest in Android coding, so I decided to download Android Studio. I decided that before I program my first application, I would first see if I could send a blank application to my developer account in order to test if it would send.
I made the project, then added a Google Cloud Module. I set the Module type as App Engine Java Servlet Module, and the client module as app. At first, the error was:
"Error: Invalid App engine SDK Path."
I soon found, however, that the reason was because the gradle appengine-java-sdk was out of date, as it was on version 1.9.18. So, I installed the latest version, which is 1.9.24. So, I turned Synchronize with build.gradle configuration.
That fixed the error, so I went to Build>Deploy Module to App Engine. I selected my module, and set my cloud ID, then hit deploy. I then get a pop-up that states:
"Cannot start uploading: The tools sdk jar could not be located."
Make sure that your JAVA_HOME global variable is pointing to your JDK location. See this answer and this other question.

Android failed to export application (due to google-play-services.jar )

I have problem when trying to sign my application in release mode from over two/three days now. I've tried everything which I find as information in internet/stackoverflow and nothing worked for me.
I did not have problem with building debug version and running on device. The only problem I get is only when I try to sign my application on release mode and I get this error message. “Android library project cannot be exported” and I noticed that this happen when I added “google-play-services.jar” to my project android library for adMob.
Instead of using the Google Play Services jar as dependency, add the Google Play Services library project in your application. Instructions for this can be found at http://developer.android.com/google/play-services/setup.html#Setup

Eclipse does not work after update through Android SDK Manager

I have just updated my eclipse through Android SDK Manager, my eclipse pop out and error about the Android SDK.
This Android SDK requires Android Developer Toolkit version 23.0.0 or above.
Current version is 22.6.2.v201403212031-1085508
When I pressed the button "Check for Updates", the result from eclipse is "No Updates were found."
I am sure that my Android SDK should be 23.0.0 above.
All my project listed in the left corner of above picture contains errors.
I have studied this thread and I found that the "Java build path" was "Unable to get system liberary for the project"
The project was not built since its build path is incomplete
Whenever I tried to add the JRE System Library, it failed beacause of "Could not write file: C:\Users\Admin\workspace\ICEAPP(20140819_uc).classpath."
Can anyone give me so help?
Update the ADT-Plugin in eclipse (Help > Check for updates)
You have to remove the whole installation and reinstall everything again. This update seems to fail always. But reinstall works for all of this issues. With the new version 23. It seems there is a big compatibillity problem unsolved yet.
Check for updated fails but eclipse say it need one update. Also SDK Manager seems to be up to date.
Anyway, even if you get ot working, there still are problems for example with implementation of google play service.
Had a lot of issues by myself and others to, but reinstall solved it

How to run maven project on google app engine

I follow this tutorial: http://software.danielwatrous.com/wordpress-plugin-licensing-wicket-on-google-app-engine/. I add google app engine library to this project and then I want to check google app engine on. But when I do this eclipse has this problem:
The App Engine SDK '/home/hudi/program/git/tournamenSystem/tournament-system/
tournament-system-web/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.7.1.jar'
on the project's build path is not valid (SDK location '/home/hudi/program/git/
tournamenSystem/tournament-system/tournament-system-web/src/main/webapp/WEB-INF/
lib/appengine-api-1.0-sdk-1.7.1.jar' is not a directory)
I dont understand it. Jar isnt directory so why it want to some directory ? When I want use quick fix then I can just use another SDK. I try to use older version 1.6... but still same problem. How I can fix it ? Please help
Possible solution is that, you should add appengine through app engine settings in eclipse and make sure that the sdk added by appengine setting appear before the one mentioned (i.e. /home/hudi/program/git/tournamenSystem/tournament-system/tournament-system-web/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.7.1.jar) in your build path. In this way your application would refer the appengine sdk from google plugin and not for the path which is giving error.
I had same issue where I was getting error for the sdk jar included from maven dependency.Hope it will help.
You may want to take a look at the Maven GAE Plugin
This plugin has goals to run, debug, deploy, etc. your GAE application.
On my computer with Ubuntu 12.04 and Eclipse Juno SR1
I just move all maven dependencies to the button of the list of Java build path.
For open Java build path window right click on the project
- preferences
- Java build path
- Order and Export
- select all row with M2_REPO(or some thing else) and press button "Bottom"
- Refresh project.
This need help.
Thank you!

NoClassDefFoundError when running Facebook official example

Sorry I am new, stackoverflow does not
allow me to post image and links...
I try to use Official Android SDK (http://github.com/facebook/facebook-android-sdk/). I install the SDK and try to run the Example
At first, it fails at "build", it cannot find the Facebook SDK, so I try to follow the steps found in SDK page:
Add a dependency on the Facebook
Android SDK library on your
application:
from the File menu, select "Properties"
once the project Properties are displayed, open the Android section,
which should list the build targets
and libraries
in the bottom "Library" section, click "Add..." and select the Facebook
SDK project
refer to http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject
for more details
I check the link at #4, it shows a Mac OS X version Eclipse, which has Library section, but on my Vista PC, with Eclipse 3.5.2, it does not have Library section...
-http://developer.android.com/images/developing/adt-props-isLib.png
-http://farm5.static.flickr.com/4138/4852346022_fc8f6bedbe_b.jpg
I try to add the Facebook SDK in Java Build Path. Now it can "build" and start, on both Emulator and Device. However, once it started, it crash, the logcat shows:
ERROR/AndroidRuntime(518): java.lang.NoClassDefFoundError: com.facebook.android.Util
-http://farm5.static.flickr.com/4138/4852346048_f4a3b998a3_b.jpg)
I searched around, about "NoClassDefFoundError" program, but seems those solution is solving external JARs files. I have no problem adding other JARs files, and this Facebook SDK is not JAR...
I tried Clean, rebuild, delete everything and config again, but can't solve this problem yet.
Anyone have idea please help, Thanks.
This exception is thrown if a class could not be found at runtime even if it was available when the program was compiled. You need to double check that the SDK jars are available to then program in the launch configuration. This includes the jars being physically present ón the device.

Categories