Why are Log.d() and Log.v() not printing

前端 未结 10 2160
难免孤独
难免孤独 2020-12-10 10:15

I have the following test code in my Activity:

@Override
public void onStart() {
    super.onStart();
    Log.e(CLASS_NAME, \"ERROR onStart()\");
    Log.w(C         


        
10条回答
  •  眼角桃花
    2020-12-10 10:57

    This started happening with me in Android Studio 3. I was getting old Log.v's printing, but when I added a new one nothing happened. Ditto with debugger breakpoints.

    Cleaning the solution and restarting Android Studio worked for me, but there was a simpler solution.

    Disable Instant Run. It seems that Instant Run doesn't recognise new Log.v's or breakpoints.

    Along the way I also added Gradle-aware Make to my Run/Debug configuration for the main activity. I don't know whether that was necessary, but I'm keeping it. ([Main Menu] Run -> Edit Configurations...)

提交回复
热议问题