Evernote / evernote-sdk-android

Evernote SDK for Android
428 stars 168 forks source link

Invoke authorization when evernote client doesn't login could lead to crash. #50

Closed jinksw closed 9 years ago

jinksw commented 9 years ago

in my app, I call EvernoteSession.authorize(this) to start authorization. then the evernote sdk's progress dialog show, and later ,a crash dialog was shown.

I find that it only happened when I didn't login in in the Evernote app.

when I have already login in in the Evernote app, and then call EvernoteSession.authorize(this) from my app,It can work.

so ,for simplicity. the issue is when I don't login in in the Evernote App,It will crash when third part app use Evernote App to authorize. and I use YinXiangBiJi app.

here is the log message.

E/Parcel ( 857): Reading a NULL string not supported here. E/msm8974_platform( 292): platform_update_tpa_poll: Could not get ctl for mixer cmd - TPA6165 POLL ACC DET E/EN (14193): [ev] - Uncaught exception E/EN (14193): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.evernote/com.evernote.ui.landing.AuthorizeThirdPartyAppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) E/EN (14193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386) E/EN (14193): at android.app.ActivityThread.access$800(ActivityThread.java:148) E/EN (14193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) E/EN (14193): at android.os.Handler.dispatchMessage(Handler.java:102) E/EN (14193): at android.os.Looper.loop(Looper.java:135) E/EN (14193): at android.app.ActivityThread.main(ActivityThread.java:5310) E/EN (14193): at java.lang.reflect.Method.invoke(Native Method) E/EN (14193): at java.lang.reflect.Method.invoke(Method.java:372) E/EN (14193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) E/EN (14193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) E/EN (14193): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.g(AuthorizeThirdPartyAppActivity.java:123) E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.onCreate(AuthorizeThirdPartyAppActivity.java:88) E/EN (14193): at android.app.Activity.performCreate(Activity.java:5953) E/EN (14193): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128) E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) E/EN (14193): ... 10 more E/EN (14193): [ev] - Uncaught exception, Notifying real exception handler E/EN (14193): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.evernote/com.evernote.ui.landing.AuthorizeThirdPartyAppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) E/EN (14193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386) E/EN (14193): at android.app.ActivityThread.access$800(ActivityThread.java:148) E/EN (14193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) E/EN (14193): at android.os.Handler.dispatchMessage(Handler.java:102) E/EN (14193): at android.os.Looper.loop(Looper.java:135) E/EN (14193): at android.app.ActivityThread.main(ActivityThread.java:5310) E/EN (14193): at java.lang.reflect.Method.invoke(Native Method) E/EN (14193): at java.lang.reflect.Method.invoke(Method.java:372) E/EN (14193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) E/EN (14193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) E/EN (14193): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.g(AuthorizeThirdPartyAppActivity.java:123) E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.onCreate(AuthorizeThirdPartyAppActivity.java:88) E/EN (14193): at android.app.Activity.performCreate(Activity.java:5953) E/EN (14193): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128) E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) E/EN (14193): ... 10 more E/AndroidRuntime(14193): FATAL EXCEPTION: main E/AndroidRuntime(14193): Process: com.evernote, PID: 14193 E/AndroidRuntime(14193): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.evernote/com.evernote.ui.landing.AuthorizeThirdPartyAppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/AndroidRuntime(14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) E/AndroidRuntime(14193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386) E/AndroidRuntime(14193): at android.app.ActivityThread.access$800(ActivityThread.java:148) E/AndroidRuntime(14193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) E/AndroidRuntime(14193): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(14193): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(14193): at android.app.ActivityThread.main(ActivityThread.java:5310) E/AndroidRuntime(14193): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(14193): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(14193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) E/AndroidRuntime(14193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) E/AndroidRuntime(14193): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/AndroidRuntime(14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.g(AuthorizeThirdPartyAppActivity.java:123) E/AndroidRuntime(14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.onCreate(AuthorizeThirdPartyAppActivity.java:88) E/AndroidRuntime(14193): at android.app.Activity.performCreate(Activity.java:5953) E/AndroidRuntime(14193): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128) E/AndroidRuntime(14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) E/AndroidRuntime(14193): ... 10 more E/msm8974_platform( 292): platform_update_tpa_poll: Could not get ctl for mixer cmd - TPA6165 POLL ACC DET

vRallev commented 9 years ago

The issue was in the main Evernote app and not the SDK itself. It's been fixed and you should update Evernote. Version 7.1 was released on Friday last week together with the fix.

Thanks for your help!