简体   繁体   中英

Android-Studio: Java logs missing when debugging JNI

I am facing a issue in AndroidStudio after i updated AndroidStudio to 2.2.1 and also updated my project to use the latest gradle (2.14.1) and gradle-plugin (2.2.1), and implemented some cpp/jni code (CMakeList setup).

Before i did this changes, when i started debugging my app, AndroidStudio would open a "debug" panel with a Console that displayed logs from java.

Now after the update and cpp integration, this debug-panel still opens, but now i have 2 tabs in there, each containing a Console (1 for cpp and 1 for java output). But the java console stopped displaying any of my java logs. all that gets printed to this console is: Connected to the target VM, address: 'localhost:8600', transport: 'socket'

In the cpp console i get a few lines of output. This contains the logs from the apk install process ($adb push ... $adb shell pm install ... $adb shell am start ...), and than some logs that tell me that it waited for the app to come online, than started a LLDB server and finally attached the Debugger to the process.

I can set breakpoints both in java and in cpp, just the the java logs stopped working.

I have the feeling that i am missing something obvious.

Hope someone has seen this problem before and can tell me how i get my java logs back to show up in one of the Consoles.

[Update:] When i just run the apk, not debugging, the console of the "run" panel displays logs from both cpp and java. Only when debugging, i get no logs. neither from cpp nor from java.

ok. When debugging i can see my java and cpp logs inside the "logcat"-console ("Android Monitor"-tab). I did set the filter to "Verbose" and "Show only selected application". Of course the application also needs to be selected (Dropdown at top of "Android Monitor"-panel).

I think this is more a workaround than a answer to my question. It would be better if i could see the logs in the debug-panels so they are separated between cpp and java).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM