BinCodinLong
BinCodinLong

Reputation: 721

What to do when android debugger gets lost?

From time to time, when you F7 into an Android api class method, the debugger displays decompiled code but hilites non-executable statements. If you F8 through the code, the hilite hops through the it in impossible steps. It seems the debugger is displaying one code but running another. That is, the class loader is loading one code but the debugger is decompiling another.

Does anybody know what causes this, and how to fix it?

I'm targetting android version 23, so I checked folder

android-sdk/android/sources/android-23

Its timestamps were back in 2015 -- ridiculously old for a recent version. I downloaded a new version. The two are identical. However, now Android Studio complains:

Sources for Android API 23 Platform not found

Two buttons accompany the complaint on the same yellow message bar:

Download or Refresh (if already downloaded)

Neither of these buttons does anything. So, one frustration leads to another...

Upvotes: 1

Views: 288

Answers (1)

Nir Duan
Nir Duan

Reputation: 6392

Try to kill the debugger an re-attach it while process is running -

  1. Run | Stop -> kill the debbuger
  2. Run | Attach debugger to android process (last option in the menu) | choose your app's process. -> re-attaches your debugger to your app process while it's alive.

Upvotes: 1

Related Questions