question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE in prepareLog

See original GitHub issue

I’m facing a strange NPE after progaurd:

java.lang.NullPointerException: Attempt to get length of null array
                                             at timber.log.Timber$Tree.void prepareLog(int,java.lang.Throwable,java.lang.String,java.lang.Object[])(Timber.java:537)
                                                                       void log$4414f3(int,java.lang.String,java.lang.String)
                                             at timber.log.Timber$Tree.void v(java.lang.String,java.lang.Object[])(Timber.java:404)
                                                                       void log$4414f3(int,java.lang.String,java.lang.String)
                                             at timber.log.Timber$1.void v(java.lang.String,java.lang.Object[])(Timber.java:217)
                                             at timber.log.Timber.void v$70a742d2(java.lang.String)(Timber.java:21)
                                             at com.app.android.io.network.NetworkModule$$Lambda$1.void log(java.lang.String)(Unknown Source)
                                                                                                                 void com.coyoapp.messenger.android.io.network.NetworkModule.lambda$provideLoggingInterceptor$78(java.lang.String)
                                                                                                                 void log(java.lang.String)
                                                                                                                 okhttp3.logging.HttpLoggingInterceptor$Logger lambdaFactory$()
                                             at okhttp3.logging.HttpLoggingInterceptor.okhttp3.Response intercept(okhttp3.Interceptor$Chain)(HttpLoggingInterceptor.java:159)
                                             at okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request,okhttp3.internal.connection.StreamAllocation,okhttp3.internal.http.HttpCodec,okhttp3.internal.connection.RealConnection)(RealInterceptorChain.java:92)
                                             at okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request)(RealInterceptorChain.java:67)
                                             at okhttp3.RealCall.okhttp3.Response getResponseWithInterceptorChain()(RealCall.java:185)
                                             at okhttp3.RealCall.okhttp3.Response execute()(RealCall.java:69)
                                             at retrofit2.OkHttpCall.retrofit2.Response execute()(OkHttpCall.java:180)
                                             at retrofit2.adapter.rxjava2.CallExecuteObservable.void subscribeActual(io.reactivex.Observer)(CallExecuteObservable.java:41)
                                             at io.reactivex.Observable.void subscribe(io.reactivex.Observer)(Observable.java:10842)
                                             at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.void run()(ObservableSubscribeOn.java:96)
                                             at io.reactivex.Scheduler$DisposeTask.void run()(Scheduler.java:452)
                                             at io.reactivex.internal.schedulers.ScheduledRunnable.void run()(ScheduledRunnable.java:61)
                                             at io.reactivex.internal.schedulers.ScheduledRunnable.java.lang.Object call()(ScheduledRunnable.java:52)
                                             at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
                                             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                             at java.lang.Thread.run(Thread.java:762)

Message is not null. Should we check a nullable of args at Timber.java:537 if (args.length > 0) { ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JakeWhartoncommented, Aug 15, 2017

I don’t mind fixing it in Timber since others may likely run into this. Plus it winds up saving a needless allocation.

On Mon, Aug 14, 2017 at 10:08 AM Anton Dauvalter notifications@github.com wrote:

I’ll try to exclude the Timber from proguard

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JakeWharton/timber/issues/239#issuecomment-322249115, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEeG3r-OHRQJ_sEhrQ_0S2lp_BXNxks5sYH8RgaJpZM4O2QA- .

0reactions
adauvaltercommented, Aug 14, 2017

I’ll try to exclude the Timber from proguard optimization

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collecting a Workspace ONE Access Log File Bundle
Log in to the Workspace ONE Access appliance configuration page at https:// WS1AccessHostnameFQDN :8443/cfg/logs. Click Prepare log bundle.
Read more >
Talend 6.2.1 tSalesforceBulkOutputExec fails with null pointer ...
prepareLog (SalesforceBulkRuntime.java:122) at org.talend.components.salesforce.runtime. ... Sorry, but a NullPointerException can mean a lot of things.
Read more >
Logger (@Logger) is always null (NPE) - JBoss.org
I've created a new simple project using JBoss Tools for test and use the New > Seam Generate Entities for a simple table...
Read more >
Hibernate postCollectionUpdate Trgiigers twice as it removes ...
prepareLog (event,modifier, propertyName, ... Using RowMapper and JdbcTemplate got NullPointerException · Hot Network Questions.
Read more >
Example usage for java.sql Timestamp getTime - Java2s.com
prepareLog (greq, grsiResponse, breq, bres, vreg, vres); logTransaction. ... long usecs) { if (timestamp == null) throw new NullPointerException("timestamp ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found