Recommended solutions based on your search
Android SDK 23 introduced a new way to handle permissions, so as a temporary workaround you can set it to build for SDK below 23. As a permanent solution you have to ask user during runtime for permissions with checkSelfPermission() or requestPermissions()
You need to request READ_PHONE_STATE permissions before using of this method.
Solutions on the web
java.lang.SecurityException: Invalid value for visibility: 2