3

I click on My Project -> Android Tools -> Add Support Library and get an error (which worked before I performed "Add Support Library")

I think that I have an issue with the Facebook SDK:

This is part of my mainActivity:

Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);

        Session session = Session.getActiveSession();
        if (session == null) {
            if (savedInstanceState != null) {
                session = Session.restoreSession(this, null, statusCallback, savedInstanceState);
            }
            if (session == null) {
                session = new Session(this);
            }
            Session.setActiveSession(session);
            if (session.getState().equals(SessionState.CREATED_TOKEN_LOADED)) {
                session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback));
            }
        }

In the line:

session.openForRead(**new Session.OpenRequest(this)**.setCallback(statusCallback));

it gives me an error:

The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files

Does someone know how to solve this issue?

Ry-
  • 218,210
  • 55
  • 464
  • 476
Adir Rahamim
  • 453
  • 1
  • 12
  • 31
  • have u triedsomething like this: `openReq = new Session.OpenRequest(this);` `openReq.setCallback(statusCallback);` `session.openForRead(openReq);` – Shoshi Mar 06 '13 at 15:48

2 Answers2

0

I resolved checking Android Private Libraries in Build Path -> Order and Export of My Project, Facebook-SDK Project and Other Project Linked

Checking Android Private Libraries

From Here

Community
  • 1
  • 1
DonMizzi
  • 566
  • 1
  • 6
  • 17
-1

Last time when I tried using the "Add Support Library" function, the console kept saying "Found 2 versions of android-support-v4.jar in the dependency list"

Check your project's libs folder and remove android-support-v4.jar if it's there, it is because Facebook SDK already include that library.

See if it helps.

Tim Ngan
  • 9
  • 2