How to remove all debug logging calls before building the release version of an Android app?

前端 未结 27 2024
有刺的猬
有刺的猬 2020-11-22 07:39

According to Google, I must \"deactivate any calls to Log methods in the source code\" before publishing my Android app to Google Play. Extract from section 3 of th

27条回答
  •  感动是毒
    2020-11-22 08:11

    Why not just do

    if(BuildConfig.DEBUG)
      Log.d("tag","msg");
    

    ? No additional libraries needed, no proguard rules which tend to screw up the project and java compiler will just leave out bytecode for for this call when you make release build.

提交回复
热议问题