I'm trying to use the Facebooks API for android to make a login function in my app....
I've followed this tutorial http://javatechig.com/android/using-facebook-sdk-in-android-example
And copied the exact same code... it took me a time to discover that there wasn't nothing wrong with my code...
But, whenever I click the login button I get an exception and the login performs but when the app is returned the session is not opened.
In the logcat I got this.
04-22 22:11:15.570 31114-31122/com.myapppackage.app E/System﹕ Uncaught exception thrown by finalizer
04-22 22:11:15.570 31114-31122/com.myapppackage.app E/System﹕ java.lang.IllegalStateException: Binder has been finalized!
at android.os.BinderProxy.transact(Native Method)
at android.database.BulkCursorProxy.close(BulkCursorNative.java:288)
at android.database.BulkCursorToCursorAdaptor.close(BulkCursorToCursorAdaptor.java:133)
at android.database.CursorWrapper.close(CursorWrapper.java:49)
at android.content.ContentResolver$CursorWrapperInner.close(ContentResolver.java:1591)
at android.content.ContentResolver$CursorWrapperInner.finalize(ContentResolver.java:1604)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
at java.lang.Thread.run(Thread.java:856)
Does anyone know why is this happening?
I'm using latest facebook SDK (3.8) with android studio... I'm pretty sure I configured the SDK right because the test sample in Facebook's page works (get the name of a profile)... but login isn't working.
I recommend you to clean the project and check your AppId.
See this question of stack overflow related to your problem.
Binder has been finalized when using Facebook's Android SDK
Hope it will help.
Related
I'm developing an android app using firebase auth and firebaseUI. My problem is that I can't create a new user via the "Sign in via email" flow. However, when logging in with an existing account everything works fine.
In detail this means the app crashes everytime I click the "Continue" button after entering the email address, with the following error in logcat:
E/UncaughtException: java.lang.IllegalArgumentException: Unique transitionNames are required for all sharedElements
at android.support.v4.app.BackStackRecord.addSharedElement(BackStackRecord.java:511)
at com.firebase.ui.auth.ui.email.RegisterEmailActivity.onNewUser(RegisterEmailActivity.java:127)
at com.firebase.ui.auth.ui.email.CheckEmailFragment$2.onSuccess(CheckEmailFragment.java:208)
at com.firebase.ui.auth.ui.email.CheckEmailFragment$2.onSuccess(CheckEmailFragment.java:204)
at com.google.android.gms.tasks.zzj.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5365)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
The problem occurs only since I upgraded
com.android.support:support-v4 from 26.1.0 to 27.0.1 and
com.google.firebase:firebase-auth from 11.4.2 to 11.6.0 .
However, I still use 'com.firebaseui:firebase-ui-auth:3.1.0' since I could not find a later version yet.
Could this be an incompatibility of the named libraries or do I miss something? My android version is 4.2.2.
Thank you in advance,
Dan
UPDATE
Update to 'com.firebaseui:firebase-ui-auth:3.1.2' didn't help. Still the same error which, by the way, does not occur on an api level 25 device.
I had hoped the update would solve the issue but as this doesn't seem to be the case I'm not really sure what to do right now. Any ideas how to troubleshoot this? Please help!
The issue was is solved in 3.1.3. See also this github issue.
I have downloaded SipDemo app from official repository. I ran the app and made SIP calls from my phone. But I want to integrate SIP calls into my own app. I copied code from SipDemo app into my own project, ran a project. When I want to make a SIP call I get an error:
21319-21319/com.app.myapplication I/WalkieTalkieActivity/InitiateCall﹕ Error when trying to close manager.
android.net.sip.SipException: Failed to create SipSession; network unavailable?
at android.net.sip.SipManager.createSipSession(SipManager.java:555)
at android.net.sip.SipManager.makeAudioCall(SipManager.java:328)
at android.net.sip.SipManager.makeAudioCall(SipManager.java:359)
at com.tickets.myapplication.WalkieTalkieActivity.initiateCall(WalkieTalkieActivity.java:221)
at com.tickets.myapplication.WalkieTalkieActivity$5.onClick(WalkieTalkieActivity.java:332)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:4952)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
I don't know why this error happens and how to fix it. Does someone know what is the reason of this error?
EDIT
Finally I have found problem. SipDemo app uses targetSdkVersion 9 in my project I use latest android version. Seems problem in the newest version of android.net.sip.SipManager.
My solution is to create library project with targetSdkVersion 9 and add dependency to working project. Now it works ok for me.
I am actually working on an Android VOIP application that let user create conference with other users. My constraints are to avoid any use of a server like SIP servers to realise it and if I have to use a external library, it should be under LGPL license. I have succesfully done it in a peer-to-peer fashion using the AudioGroup and AudioStream classes of the android RTP stack.
My problem occurs in a 3-peers conference. Using AudioGroup, I have enabled the MODE_ECHO_SUPPRESSION but the results are very poor and I can hear my echo after 3 seconds. I came to conclusion that the Android RTP stack was not a good solution to my problem beacause using AudioGroup make impossible to tweek the sound and echo suppression seems to function badly.
By testing VOIP applications, I discovered a lot that were working pretty weel and more precisely Jitsi (homepage) which use a java library based on native code for the RTP stuff under the LGPL licence. I tried to follow this tutorial to use libjitsi but unfortunatly it gives me an error... At this time, I'm not sure that it is possible to use Libjitsi on an android project as it is normally used in Java projects.
Steps I went trough to get the error (using Android Studio)
I have compiled libjitsi from the build.xml contained in the sources and putted the resulting jar directly in the lib/ folder of my project.
I have added a dependency to libjitsi.jar in my build.gradle file
Called the static method Libjitsi.start() in the onCreate method of an activity
Error log
01-02 17:06:48.304 1523-1523/com.test.example I/LibJitsi﹕
Failed to initialize LibJitsi backend
org.jitsi.impl.libjitsi.LibJitsiOSGiImpl. (Exception stack trace
follows.) Will try an alternative.
java.lang.NoClassDefFoundError: org.osgi.framework.FrameworkUtil
at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.(LibJitsiOSGiImpl.java:34)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:227)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:171)
at com.test.example.ui.createconf.CreateConfActivity.onCreate(CreateConfActivity.java:76)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native
Now if anyone already tried to use libjitsi on an AndroidProject or if you know it's not feasible, I would really be gratefull if you share your experience with me.
Thanks
Yes libjitsi dependency can be added to android, you can try jitsi-android which is an Android port of the Jitsi project . I have tried to run their sample app and it compiled fine.
However , I have shared 5 different libraries for VOIP calling on android in another answer you can have a look and try them.
Njoy!
I am using Facebook android SDK 3.0 (quite new to it), and running the sample SessionLoginSample located in the sample directory of the downloaded SDK. The target is to test if the session login sample can trigger the browser and lead user to the Facebook login page without the Facebook for Android application installed. No luck, the SessionLoginSample force closed.
However, if the Facebook for Android app installed, the user could be lead to the login activity of the app. Enter the account/password then go back the SessionLoginSample without any issue. It looks like the Session object won't trigger browser and lead user to Facebook login page?
Edit: append the log
02-10 15:35:46.180: ERROR/AndroidRuntime(29604): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity {com.facebook.samples.sessionlogin/com.facebook.LoginActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x7f050012
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2455)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2483)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1997)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4511)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f050012
at android.content.res.Resources.getText(Resources.java:260)
at android.content.res.Resources.getString(Resources.java:344)
at android.content.Context.getString(Context.java:282)
at com.facebook.widget.WebDialog.onCreate(WebDialog.java:188)
at android.app.Dialog.dispatchOnCreate(Dialog.java:353)
at android.app.Dialog.show(Dialog.java:257)
at com.facebook.AuthorizationClient$WebViewAuthHandler.tryAuthorize(AuthorizationClient.java:461)
at com.facebook.AuthorizationClient.tryCurrentHandler(AuthorizationClient.java:209)
at com.facebook.AuthorizationClient.tryNextHandler(AuthorizationClient.java:188)
at com.facebook.AuthorizationClient.authorize(AuthorizationClient.java:116)
at com.facebook.AuthorizationClient.startOrContinueAuth(AuthorizationClient.java:97)
at com.facebook.LoginActivity.onResume(LoginActivity.java:113)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1157)
at android.app.Activity.performResume(Activity.java:4544)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2445)
... 12 more
Solve the original problem:
Just found the strings.xml file in the values folder in the res folder of Facebook android SDK has been changed! The WebDialog works without problem after copy the string items back. Quite weird, I NEVER change that file manually. I am using IntelliJ IDEA 12 as the IDE to build and run my project. Might be this problem caused by IntelliJ IDEA??
Do you have any debug log you can share ? It's quite possible that something hasn't built properly as I have run the app without having a facebook app installed on my device. The app shows a loginButton which triggers the login dialog.
We recently introduced OAuth login in our app. This means using a WebView to authenticate the user, and an AsyncTask to do necessary REST calls afterwards.
Unfortunately, after introducing this login method, we're getting reports of the app force closing. This seems to be related to other AsyncTasks that are executed after the login, but the stack traces does unfortunately not tell us much:
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3100)
at android.view.View.performClick(View.java:3627)
at android.view.View$PerformClick.run(View.java:14329)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4511)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3095)
... 11 more
Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask
at com.foo.bar.TransmissionActivity.transmit(TransmissionActivity.java:44)
... 14 more
We managed to fix the error above by using RoboAsyncTask (from RoboGuice), instead of AsyncTask from the Android SDK, but we have other activities that use WebViews. WebView apparently uses AsyncTask somewhere in its call stack, and errors similar the one shown above (Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask) have started to show in our error logs.
The error happens on different devices, and different Android versions, with no apparent pattern. We have tried to reproduce the error ourselves, without any luck.
Any ideas?
It might be an issue with the build setup. (Build order of src/gen has been known to cause some issues, the libs folder for the compat library being called lib has caused some issues for me on new sdk versions).
To see if it is create a new project (in eclipse, since that's 100% android official). Add a webview and an asynctask and then do a diff on the project with your project. Ignoring src/gen/res. Hopefully you'll find that the src/gen are built in the wrong order or something like that.
~ Anders