Context capture crash when pressing "Load strings"
aphexcx opened this issue · 12 comments
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();
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.
Here you go! This log will expire in 1 hour. https://pastebin.com/XfakhZ0L
Our minSDK is 16 and our compile SDK is 25. This is on a phone running API25 (7.1.2).
Sorry, @aphexcx I phrased that wrong. What version of the Smartling SDK are you using?
Have the same issue here as well, I've tried downgrading to 2.4 but still run into the same crash.
@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)
@tiensi Yes, and logs tagged SmartlingSdk
before that crash?
@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
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.