Android : Accidental Octal Lint Warning

Posted on : Wed, 15th Apr 15 01:44 pm (Updated on : Wed, 15th Apr 15 01:44 pm) UTC
Author : Code2care
100+ votes

Android Lint tool used to check Android Project codes for potential bugs and provides suggestions to optimize your code. This tools helps to improve correctness, security, performance, usability, accessibility, and internationalization.

If you using Android Studio or Android ADT for Eclipse or any other IDE for Android, you will find that when you compile your project the IDE automatically runs the Lint programs and provides warnings, errors and other informations related to your code.

If you are get an Error : Accidental Octal then it is because you are using Groovy and an integer literal that starts with a leading 0 that is being interpreted as an octal number. You get this error because this may be an accident addition of 0 which can lead to subtle bugs, for example when used in the versionCode of an app.

If you want to suppress this Error message to a warning or a info type,


  1. Go to Android Studio Welcome Screen.
  2. Click on Configure
  3. Project Defaults
  4. Settings
  5. Select Inspections
  6. Search for Accidental Octal
  7. Now under Option Change Severity to Info instead of Error
  8. Apply changes and we are done!!

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +