In the latest Unity version, to fix that problem you need to go to Edit > Project Settings > Player. building for Android, you select the Android icon.
Press (Ctrl+Shift+B) then Player settings -> Player ->Other Settings -> Settings for Android -> there is Package name (com.DefaultCompany.projectname).