Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting error on Session.openActiveSession - Facebook SDK 3.0.2
    primarykey
    data
    text
    <p>I setup whole new project and test code from guide <a href="https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/" rel="nofollow">https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/</a> Everything went great, but I'm getting force close when I add this code to my own app. </p> <pre><code> Session.openActiveSession(this, true, new Session.StatusCallback() { </code></pre> <p>This line causes force close</p> <p>Code </p> <pre><code> @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.przegladaj_layout); // next line is 79, and makes force close Session.openActiveSession(this, true, new Session.StatusCallback() { // callback when session changes state @Override public void call(Session session, SessionState state, Exception exception) { if (session.isOpened()) { // make request to the /me API Request.executeMeRequestAsync(session, new Request.GraphUserCallback() { // callback after Graph API response with user object @Override public void onCompleted(GraphUser user, Response response) { if (user != null) { TextView welcome = (TextView) findViewById(R.id.ulubionetv); welcome.setText("Hello " + user.getName() + "!"); } } }); } } }); /* rest of code */ /* after onCreate */ @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data); } </code></pre> <p>AndroidManifest</p> <pre><code> &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;meta-data android:value="@string/app_id" android:name="com.facebook.sdk.ApplicationId"/&gt; &lt;activity android:label="@string/app_name" android:name="com.facebook.LoginActivity"&gt;&lt;/activity&gt; </code></pre> <p>Logcat output</p> <pre><code> 07-27 18:10:33.897: E/Trace(15621): error opening trace file: Permission denied (13) 07-27 18:10:34.413: E/AndroidRuntime(15621): FATAL EXCEPTION: main 07-27 18:10:34.413: E/AndroidRuntime(15621): java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager 07-27 18:10:34.413: E/AndroidRuntime(15621): at com.facebook.Session.postActiveSessionAction(Session.java:1215) 07-27 18:10:34.413: E/AndroidRuntime(15621): at com.facebook.Session.setActiveSession(Session.java:765) 07-27 18:10:34.413: E/AndroidRuntime(15621): at com.facebook.Session.openActiveSession(Session.java:865) 07-27 18:10:34.413: E/AndroidRuntime(15621): at com.facebook.Session.openActiveSession(Session.java:805) 07-27 18:10:34.413: E/AndroidRuntime(15621): at pl.evelan.law.murphy.ActPrzegladaj.onCreate(ActPrzegladaj.java:79) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.Activity.performCreate(Activity.java:5058) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2104) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2178) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.ActivityThread.access$700(ActivityThread.java:141) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.os.Handler.dispatchMessage(Handler.java:99) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.os.Looper.loop(Looper.java:137) 07-27 18:10:34.413: E/AndroidRuntime(15621): at android.app.ActivityThread.main(ActivityThread.java:5118) 07-27 18:10:34.413: E/AndroidRuntime(15621): at java.lang.reflect.Method.invokeNative(Native Method) 07-27 18:10:34.413: E/AndroidRuntime(15621): at java.lang.reflect.Method.invoke(Method.java:511) 07-27 18:10:34.413: E/AndroidRuntime(15621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 07-27 18:10:34.413: E/AndroidRuntime(15621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 07-27 18:10:34.413: E/AndroidRuntime(15621): at dalvik.system.NativeStart.main(Native Method) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload