MFlisar/Lumberjack

Synthetic stacktrace didn't have enough elements: are you using proguard?

Isanderthul opened this issue · 5 comments

After adding your library, I am now getting these errors, causing crashes

02-06 13:03:55.226 22472-23118/za.co.demo.app 
E/AndroidRuntime: FATAL EXCEPTION: SyncAdapterThread-2
  Process: za.co.demo.app, PID: 22472
  java.lang.IllegalStateException: Synthetic stacktrace didn't have enough elements: are you using proguard?
      at timber.log.BaseTree.getTag(BaseTree.java:54)
      at timber.log.Timber$Tree.prepareLog(Timber.java:521)
      at timber.log.Timber$Tree.d(Timber.java:417)
      at timber.log.Timber$1.d(Timber.java:239)
      at timber.log.Timber.d(Timber.java:34)
      at za.co.demo.app.adaptors.SyncAdapter.onPerformSync(SyncAdapter.java:278)
      at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)

I thought it might be related to Timber.i so I changed all my Timber.i("") to Timber.d("") but it did not help.

I am using Timber. (not L.)

 } else {
            Timber.d("Upload Sync: ending");
            unlockTheSync();
        }

What happens if you just try L.d(...)? My BaseTree is actually just and extended version of the debug tree of timber and I manually deifne a correct stack trace depth here: https://github.com/MFlisar/Lumberjack/blob/master/library/src/main/java/timber/log/BaseTree.java#L24. This depth only is correct, if you use L.d(...)... The normal timber log tree only has a depth of 5, I need a higher depth, because my functions are wrappnig the normal timber calls...

aah ok.

I'll close this, I think we can discuss possible solutions in the other issue