32

After updating my ADT plugin to version 17 I'm getting a warning massage saying

Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one

There wasn't such message before the update.

How can I avoid this warning message ?

Chrishan
  • 4,076
  • 7
  • 48
  • 67

2 Answers2

20

Yup, just noticed this too. I removed the debuggable attribute from the manifest, and I can now both run the app in debug mode and export it to a market-ready APK file without changing any code.

Slick!

Full explanation here https://stackoverflow.com/a/4580630/682754

Community
  • 1
  • 1
Andy
  • 503
  • 4
  • 10
  • 1
    I'm curious too how it works. So does that means I don't need to remove any "Log.d()" from my code when publishing released apk? – null Apr 18 '12 at 04:33
17

Ran into this myself today and was frustrated with the accepted answer; I don't want to trust Eclipse to "do the right thing" when it so often doesn't.

The answer to the question asked is to go to Window->Preferences->Android->Lint Error Checking or Project Properties->Android Lint Preferences and change the severity of the warning.

Maciek Czarnik
  • 5,950
  • 2
  • 37
  • 50
jdowdell
  • 1,578
  • 12
  • 24
  • 8
    Just to clarify for anyone the preference your looking for is called'HardcodedDebugMode' under the 'Security' heading. This worked for me. Thanks – Hevski Jun 27 '14 at 14:44