Facebook SDK library disabling - android

I've added the Facebook SDK for for Android project to my workspace, but when I try to add it as a library to my project it keeps getting disabled. When I add it (by "Properties -> Android -> Library") it gets a green checkmark, but when I press apply/OK and return, it turned into a red cross..
I also added it at "Properties -> Java Build Path -> Libraries" as an external JAR file.

Related

google-play-services_lib eclipse kepler noclassdeffounderror

I have read all the post about this argument and I try all but i can't find a solution
I try to add to my app Google Cloud Messaging start follow the official google guide at http://developer.android.com/google/gcm/client.html
and
http://developer.android.com/google/play-services/setup.html#Setup
I install Playservices through Android SDK Manager and now I can't view the folder in android-sdk\extras\google\google_play_services
In Eclipse Kepler:
File -> Import -> Existing Android Code into Workspace
Root Directory:
....android-sdk\extras\google\google_play_services\libproject\google-play-services_lib
Copy project into workspace is selected.
Now i have play services library project in my workspace and listed in Package explorer and I can add reference to my project
My project -> Properties -> Android -> Library -> add... --> select google-play-services_lib -> ok -> Apply
In Java Build Path -> Order and Export I find:
.../gen ->selected
.../src ->selected
Android Private Libraries ->selected
Android 4.2.2 ->not selected
Android Dependencies ->selected
I continue the google guide "Implementing GCM Client"
Add lines to my manifest file and modify my onCreate and onresume like explained in "Check for Google Play Services APK"
All is ok and no compile error in eclipse.
When I try to run on emulator or on physical device (Galaxy S3 - Android 4.3) I have runtime error in logcat:
java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil
This is the code that have generate the error:
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
Seems that need library is not export in apk....
What I missing to do?
I had this same problem and what worked for me was changing the target for the google-play-services_lib project. To do that, right click on google-play-services_lib and choose "Properties". Next, at the top of the "Android" menu, under "Project Build Target", select the same target as the target of your main project.
I hope this helps.

Zxing library cannot function correctly

I created project with android/ and included core-2.3.0.jar in it's libs/. Set this project as library. Set my project include the library project. But when I finished setting and close the project property and open again, the project library change to a cross icon. Why?
If I ignore this and go to run my project, button clicked, exception: java.lang.NoClassDefFoundError: com.google.zxing.client.android.R$layout
Use this link https://stackoverflow.com/a/19293128/958850
In eclipse select Create a android project from existing source.
browse your zip file for android folder[this is a sample project
bundeled with the library] your project should be imported with few
errors
The actual core library is missing, We should add the ZxingCore
library from process 1
right click project -> properties -> JavaBuildPath(from left pane)
-> project tab -> add -> check ZxingCore - Ok.
All the errors should have gone now. it time to make the barcode
scanner app to be a library project
right click project -> properties -> android(from left pane) ->
check isLibrary -> apply -> OK.
Now you will get errors in some switch case statements. Convert the
problematic switch case statements to it..elseif
Your library project is ready
for those who want to run the barcode scanner as a stand alone app
skip the steps 5,6,7,8

Zxing 2.2 import as a library project(not .jar) in eclipse

I have downloaded the zxing 2.2 code from the below link
https://code.google.com/p/zxing/downloads/list
My requirement is to import the "core" project into eclipse and add few code into it. then mark it to be library project.
I want to include this library project into barcode scanner sample app and use the barcode scanner app as library from my project.
Solved
prerequisties download latest zxing package.
Process 1
create a java project in eclipse.and name it to something like ZxingCore.
copy and paste complete src folder inside core folder.
In case you need to edit any code, you can do it. otherwise skip this
step.
Java library is ready to be used.
[Note: Compile Java project using Java 1.6 to get rid of run time exceptions]
Process 2
In eclipse select Create a android project from existing source.
browse your zip file for android folder[this is a sample project
bundeled with the library] your project should be imported with few
errors
The actual core library is missing, We should add the ZxingCore
library from process 1
right click project -> properties -> JavaBuildPath(from left pane)
-> project tab -> add -> check ZxingCore - Ok.
All the errors should have gone now. it time to make the barcode
scanner app to be a library project
right click project -> properties -> android(from left pane) ->
check isLibrary -> apply -> OK.
Now you will get errors in some switch case statements. Convert the
problematic switch case statements to it..elseif
Your library project is ready
for those who want to run the barcode scanner as a stand alone app
skip the steps 5,6,7,8

Android - Installing Pager Sliding Tab Strip in Eclipse

I'm trying to install the Pager Sliding Tab Strip library and demo app into eclipse, but I get errors on installation and compile errors.
the library is here: https://github.com/astuetz/PagerSlidingTabStrip
What I have done is:
downloaded the zip file from github,
unzipped it into a folder on my windows PC,
in Eclipse selected File|Import, Existing Android Code into Workspace, Next, browsed to the root directory \PageSlidingTabStrip-master
Copy projects into workspace
finish
This leads to an error:
Android SDK: Resolving error markers' has encountered a problem.
Marker id 3158 not found.
However, a node in my package explorer tree is created for each of the library and the demo project, but the have compile errors.
What does the reported error mean? Am I doing something wrong? What is the correct way to use this library in Eclipse?
Do the following:
File->New->Other
Select Android Project
Select "Create Project from existing source"
Click "Browse..." and navigate to "PagerSlidingTabStrip-master" folder which you have downloaded from https://github.com/astuetz/PagerSlidingTabStrip
Check "library"! (Uncheck "sample"). Make sure "Copy to Workspace" is checked as well.
Click Finish. Now "library" is added to your workspace as a project. There are some errors detected but ignore them. You can right click on "library", go to "Refactor", and change it to "Lip_PagerSlidingTabStrip" (optional).
Right-click on your project -> Properties
In Android -> Library section, click "Add"
Select recently added "library" project, click Ok and you're all set. Make sure "Is library" in this window is unchecked.
EDIT
If you have faced an error subject to "Project cannot be build until the build path is correct", try to Quick Fix it by this option: "Add android.v4.supprt to Lib_PagerSlidingTabStrip."

How to use and package a JAR file with my Android app?

I have an API in the form of a JAR that I would like to use in my Android app. Not sure if it should be part of the project in Eclipse or kept separate and added to the project properties. This JAR also needs to be packaged with the application, so how is that done for Android apps?
As explained by this SO question:
Your Project -> right click -> Import -> Archive File -> yourjar.jar
Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar -> yourjar.jar
You must add it as "external JAR" files, and set the "Order and Export" in your Eclipse project.
Update February 2012:
Pacerier mentions in the comment having an issue (ClassNotFound) even though he did declare the library.
He had:
However, the solution was simple:
Over 1 hour wasted. Man was I pissed!
Solution: make sure your JAR is compiled with 1.6 and not 1.7.
Argh
Thanks to VonC for pointing me in the right direction. I had the same symptoms but for a different library (I needed to add org.apache.commons.codec.binary.Base64 for an Android project). The solution that worked for me was SLIGHTLY different. Herewith the steps that I followed:
Download library from http://commons.apache.org/codec/download_codec.cgi
Extract commons-codec-1.6.jar from the tarball and copy to a local
folder
In eclipse:
right-click project name
choose "Properties" from context menu
on "Libraries" tab, select "Add External JARs..."
navigate to and select commons-codec-1.6.jar from the location you extracted it to your local drive
The jar file will now appear under "referenced Libraries" in your Package Explorer and you will be able to reference the library in your code.

Categories

Resources