Comments (7)
Downstream OBA issue - OneBusAway/onebusaway-android#870
from embeddedsocial-android-sdk.
I gather from the stack trace that the call to getFragment().getString() (line 129 in /auth/GoogleAppAuthAuthenticator.java) generates an exception because the SignIn fragment which contains this object is not attached to an activity (https://stackoverflow.com/a/36745804). I get a similar stack trace by removing the SignIn fragment's mHost in a debugger.
However, I'm unable to come up with a repro without using the debugger to modify data at runtime. I'm trying to kill the app at various points in the execution but have yet to come up with anything.
@barbeau
My proposal is to add better logging information to this code block so we can identify the root cause of the issue the next time it pops up. Is there a system flag we can check to determine if the app has been killed? I'll continue trying to repro, but in the meantime, I'm just taking shots in the dark.
from embeddedsocial-android-sdk.
I gather from the stack trace that the call to getFragment().getString() (line 129 in /auth/GoogleAppAuthAuthenticator.java) generates an exception because the SignIn fragment which contains this object is not attached to an activity (https://stackoverflow.com/a/36745804).
I've avoided this issue in other async callbacks related to fragments by checking for isAdded()
before doing something that would cause an IllegalStateException, and if it's false just returning (effectively a no-op). I've seen this in other Google code as well, including the NavigationDrawerFragment
we use in OBA Android that was borrowed from a Google I/O app.
If you're simply getting string resources here, another option would be to use the Application context (which should still exist if your code is running) via Application.get().getApplicationContext()
.
My proposal is to add better logging information to this code block so we can identify the root cause of the issue the next time it pops up.
That would be great, but how are you going to log this? AFAIK all you get via Android Developer Console is a stack trace, so you'd need to catch the exception and then log via Google Analytics or something similar. But let me know if you have other ideas.
Is there a system flag we can check to determine if the app has been killed?
AFAIK as long as your code is running the application context should still exist
from embeddedsocial-android-sdk.
We finally got an unobfuscated stack trace, from a Samsung Galaxy Note8 (greatqlteue), 6144MB RAM, Android 8.0, although this is an NPE and not an IllegalStateException
:
java.lang.NullPointerException:
at android.content.ContextWrapper.getResources (ContextWrapper.java:93)
at android.view.ContextThemeWrapper.getResourcesInternal (ContextThemeWrapper.java:127)
at android.view.ContextThemeWrapper.getResources (ContextThemeWrapper.java:121)
at android.support.v4.app.Fragment.getResources (Fragment.java:678)
at android.support.v4.app.Fragment.getString (Fragment.java:700)
at com.microsoft.embeddedsocial.auth.GoogleAppAuthAuthenticator$1.onTokenRequestCompleted (GoogleAppAuthAuthenticator.java:129)
at net.openid.appauth.AuthorizationService$TokenRequestTask.onPostExecute (AuthorizationService.java:308)
at net.openid.appauth.AuthorizationService$TokenRequestTask.onPostExecute (AuthorizationService.java:238)
at android.os.AsyncTask.finish (AsyncTask.java:695)
at android.os.AsyncTask.-wrap1 (Unknown Source)
at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:712)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6940)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
from embeddedsocial-android-sdk.
From a quick look at the code, it looks like this new NPE and the IllegalStateException are separate issues.
from embeddedsocial-android-sdk.
I opened a new issue for the above NPE at #94.
from embeddedsocial-android-sdk.
Nice I guess
from embeddedsocial-android-sdk.
Related Issues (20)
- Bintray releases only publish the default release build type
- Update Firebase dependencies HOT 3
- ES SDK disables Firebase Analytics in apps by default
- java.lang.NoSuchMethodError: No virtual method isAssignableFrom() HOT 1
- File Based Cross Zone Scripting
- This repo is missing important files HOT 9
- Android SDK handling of feed responses
- privacy policy and terms of use should be visible even if user is not signed in HOT 1
- non-signed in experience should still show new comment & new reply text entry
- need some indication that images are still loading
- Update to new OpenID AppAuth-Android version that includes support library v26
- Comment and reply hint text contains extra "?"
- Pins feed does not display all pinned topics
- NPE in code path through EmbeddedSocial.initGlobalObjects() HOT 3
- NPE in GoogleAppAuthAuthenticator$1.onTokenRequestCompleted()
- Remove Firebase config from app-level google-services.json HOT 2
- Signing out of an account does not unregister it from push notifications
- NPE in DiscussionFeedFragment.onAttach() HOT 1
- NPE in ActivityFeedFragment.createPagerAdapter()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embeddedsocial-android-sdk.