Recently I have started working with Android and have ran into a specific set of errors which I guess everyone will come across when they start working with Android. So the purpose of this post is to cover as many of those errors and also solutions to these errors.
- “Could not find FacebookSDK.apk!”
Steps to Reproduce – The project required the Facebook SDK which is available here. But when you try deploy the application on to a phone or a emulator, it throws the above error. The reason behind it is, when you import the SDK in your workspace as a library project, which allows it to be shared with other projects that depend on it. Once an Android project is designated as a library project, it cannot be installed onto a device. [source]
Solution – Right Click on the project->Click on Project Properties->Under Android->Uncheck “Is Library” option->Clean and Build your project->Now try installing the library SDK
- “Session cannot be resolved to a type” | “The import.com.facebook cannot be resolved”
Steps to Reproduce – When you try to import a existing project in your workspace which has made use of Facebook libraries or APIs, the minute you start building it directly, the system will throw the above error.
Solution – Right Click on the project->Click on Project Properties->Under Android-> In references add the SDK project->Clean and Build your project->Now try building your project.
Sometimes this will still led to the same error, under those cases you might also have to do this:Right Click on the project->Click on Project Properties->Under Java build path-> In projects, add the SDK project->Clean and Build your project>Now try building your project
Tips & Tricks:
- Clean and Build your project – Do this whenever you make any property changes anywhere in the project
I will keep updating this post from time to time but if you have come across some error which is not listed above and might be helpful for others, feel free to leave that in the comments below.