1. 程式人生 > >Android Studio Project debug library show source code does not match the bytecode

Android Studio Project debug library show source code does not match the bytecode

最近接手了一些新的工程,裡面用android studio除錯library。在除錯的時候 會發現呼叫某些介面的時候 ide 提示:

source code does not match the bytecode

但是看library原始碼的確是匹配的,google了好久也沒有結論,WTF!!!!!!

不但如此Debugger下的Frames堆疊對應的介面也是不對的,我就開始懷疑是不是程式碼混淆的問題。但是去看gradle檔案debug模式下的確沒有對library進行混淆。

後來在網上查
BuildConfig.DEBUG always false when building library projects with gradle的問題時候根據android開發工程在問題中這樣解釋的:
No. this means the library used by the project is always the release version of the library. This may or may not be a problem to you.

ok這樣就解釋了 困擾我的問題!!!在除錯的時候去掉gradle中對release的混淆就好了。