Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context capture crash when pressing "Load strings" #9

Closed
aphexcx opened this issue Aug 1, 2017 · 12 comments
Closed

Context capture crash when pressing "Load strings" #9

aphexcx opened this issue Aug 1, 2017 · 12 comments
Assignees
Labels

Comments

@aphexcx
Copy link

aphexcx commented Aug 1, 2017


E/AndroidRuntime: FATAL EXCEPTION: ContextCapture
Process: com.postmates.android.courier.dev, PID: 23067
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
    at com.smartling.android.review.context.service.ContextWorker.a(SourceFile:126)
    at com.smartling.android.review.context.service.ContextWorker.loadStrings(SourceFile:112)
    at com.smartling.android.review.context.service.ContextServiceHandler.a(SourceFile:111)
    at com.smartling.android.review.context.service.ContextServiceHandler.handleMessage(SourceFile:58)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.os.HandlerThread.run(HandlerThread.java:61)

The offending line (decompiled .class file):

  @Nullable
  private String a(SmartlingProject var1) {
    Iterator var2 = var1.getTargetLocales().iterator();
@foo4u foo4u self-assigned this Aug 1, 2017
@foo4u foo4u added the bug label Aug 1, 2017
@foo4u
Copy link
Contributor

foo4u commented Aug 1, 2017

Hi @aphexcx can you share the logs from above this exception? It looks like we failed to fetch project locales and then tried to iterate on them. I'd like to understand if locale fetching failed. Thanks!

If there's anything you'd consider sensitive in the logs, you may upload the logs via Smartling's support site.

@aphexcx
Copy link
Author

aphexcx commented Aug 1, 2017

Here you go! This log will expire in 1 hour. https://pastebin.com/XfakhZ0L

@foo4u
Copy link
Contributor

foo4u commented Aug 4, 2017

Hi @aphexcx can you confirm which version of your Android SDK you are using?

@aphexcx
Copy link
Author

aphexcx commented Aug 4, 2017

Our minSDK is 16 and our compile SDK is 25. This is on a phone running API25 (7.1.2).

@foo4u
Copy link
Contributor

foo4u commented Aug 4, 2017

Sorry, @aphexcx I phrased that wrong. What version of the Smartling SDK are you using?

@aphexcx
Copy link
Author

aphexcx commented Aug 5, 2017 via email

@tiensi
Copy link

tiensi commented Aug 8, 2017

Have the same issue here as well, I've tried downgrading to 2.4 but still run into the same crash.

@andrewforester
Copy link
Contributor

Hey guys! Working on that.
@tiensi @aphexcx Could you please send logs once more?

@tiensi
Copy link

tiensi commented Aug 14, 2017

@andriipanasiuk same as aphex,

Process: com.harharhar.staging.debug, PID: 3430
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.smartling.android.review.context.service.ContextWorker.a(SourceFile:126)
at com.smartling.android.review.context.service.ContextWorker.loadStrings(SourceFile:112)
at com.smartling.android.review.context.service.ContextServiceHandler.a(SourceFile:111)
at com.smartling.android.review.context.service.ContextServiceHandler.handleMessage(SourceFile:58)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)

@andrewforester
Copy link
Contributor

@tiensi Yes, and logs tagged SmartlingSdk before that crash?

@tiensi
Copy link

tiensi commented Aug 15, 2017

@andriipanasiuk I stubbed out anything I thought was sensitive data. I added ellipses where there were some time/lots of unrelated logs in between each set.

D/SmartlingSdk: Add activity monitor to client application
D/SmartlingSdk: onActivityCreated fired for com.something
D/SmartlingSdk: Track launch
D/SmartlingSdk: onActivityStarted fired for com.something
D/SmartlingSdk: onActivityResumed fired for com.something
D/SmartlingSdk: Track show smartling strings
D/SmartlingSdk: Interceptor added
...
D/SmartlingSdk: We have already attached Activity Monitor to the app
D/SmartlingSdk: Proxying activity base context
D/SmartlingSdk: Added proxy
...
D/SmartlingSdk: Not found string Whatwhat as main value in String DB
D/SmartlingSdk: Track show smartling strings
D/SmartlingSdk: Interceptor added
...
D/SmartlingSdk: Sending events...
D/SmartlingSdk: Successfully sent events
D/SmartlingSdk: Track Context image capture failed
D/SmartlingSdk: Interceptor removed
D/SmartlingSdk: onActivityPaused fired for com.something.something
D/SmartlingSdk: onActivityCreated fired for com.smartling.android.review.activity.context.ContextCaptureDashboardActivity com.smartling.android.review.activity.context.ContextCaptureDashboardActivity@3b8de70
D/SmartlingSdk: onActivityStarted fired for com.smartling.android.review.activity.context.ContextCaptureDashboardActivity com.smartling.android.review.activity.context.ContextCaptureDashboardActivity@3b8de70
D/SmartlingSdk: onActivityResumed fired for com.smartling.android.review.activity.context.ContextCaptureDashboardActivity com.smartling.android.review.activity.context.ContextCaptureDashboardActivity@3b8de70
D/SmartlingSdk: Track show XML strings
D/SmartlingSdk: --> POST https://api.smartling.com/auth-api/v2/authenticate http/1.1
D/SmartlingSdk: Content-Type: application/json; charset=UTF-8
D/SmartlingSdk: Content-Length: 122
D/SmartlingSdk: X-NewRelic-ID: newwho?=
D/SmartlingSdk: {"userIdentifier":"hi","userSecret":"there"}
D/SmartlingSdk: --> END POST (122-byte body)
D/SmartlingSdk: <-- 200 OK https://api.smartling.com/auth-api/v2/authenticate (4368ms)
D/SmartlingSdk: Content-Type: application/json;charset=UTF-8
D/SmartlingSdk: Date: Tue, 15 Aug 2017 15:09:30 GMT
D/SmartlingSdk: Server: Apache-Coyote/1.1
D/SmartlingSdk: Vary: Accept-Encoding
D/SmartlingSdk: X-Application-Context: api-gateway:aws,redis:8443
D/SmartlingSdk: X-Application-Context: authentication:aws:8443
D/SmartlingSdk: X-Frame-Options: DENY
D/SmartlingSdk: X-SL-RequestId: something_or_another
D/SmartlingSdk: X-XSS-Protection: 1; mode=block
D/SmartlingSdk: transfer-encoding: chunked
D/SmartlingSdk: Connection: keep-alive
D/SmartlingSdk: {"response":{"code":"SUCCESS","data":{"accessToken":"spooky","expiresIn":480,"refreshExpiresIn":3660,"tokenType":"Bearer"}}}
D/SmartlingSdk: <-- END HTTP (2060-byte body)
D/SmartlingSdk: --> GET https://api.smartling.com/projects-api/v2/projects/stubbed http/1.1
D/SmartlingSdk: Authorization: Bearer argh
D/SmartlingSdk: User-Agent: SmtAndroidSDK/unspecified (Google Android SDK built for x86/7.0)
D/SmartlingSdk: X-NewRelic-ID: hahaha=
D/SmartlingSdk: --> END GET
D/SmartlingSdk: <-- 200 OK https://api.smartling.com/projects-api/v2/projects/hmm (218ms)
Content-Type: application/json;charset=UTF-8
Date: Tue, 15 Aug 2017 15:09:31 GMT
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Application-Context: api-gateway:aws,redis:8443
X-Frame-Options: DENY
D/SmartlingSdk: X-SL-RequestId: something
D/SmartlingSdk: X-XSS-Protection: 1; mode=block
D/SmartlingSdk: transfer-encoding: chunked
D/SmartlingSdk: Connection: keep-alive
D/SmartlingSdk: <-- END HTTP

@andrewforester
Copy link
Contributor

Hey guys!
This issue was reproduced only in release mode. Unfortunately, we missed it.
For now it's fixed in version 2.5.1. You are welcome to use it.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants