简体   繁体   中英

Remove debug logging in Android Studio

So I am trying to publish an Android app to the store, and I get the error message to remove all debugging from the app. Well I started to do research and the only thing I can find are post from nearly 4 years ago and people saying to use ProGuard. Well I am not exactly a Android Developer, and I don't really know any Java. I am using Android Studio to create a simple WebView application for my website. So what files and exact code do I add/remove to so I can get this published. I have added the below code the AndroidManifest.xml to the activity:

android:debuggable="false"

What else? I don't know exactly where to put the code I have seen in past StackOverflow questions. Is ProGuard now integrated into Android? I'm so confused.

EDIT** I have made sure that there are zero calls to Log, and there are no startMethodTracing() and stopMethodTracing() in my code. I am simply following the guide on how to create a simple webview app. I have created only one class myself. Also I cannot find the project.properties file in Android studio.

A few things to try:

  1. If there are any calls to stopMethodTracing() or startMethodTracing(), make sure you remove them.
  2. Make sure android:debuggable="false" (as you have done)
  3. Remove or comment any references to android.util.Log such as Log.d() or Log.i()
  4. Export your app as a signed application package, using your developer key. This automatically runs zipalign and cleans up any unnecessary resources.
  5. (Optional) Modify your project.properties file to and uncomment the proguard.config line. This should point to a proguard.cfg file that was probably generated automatically when you created the project. Proguard will obfuscate and minimize your code.

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