缺少某种权限
在AndroidManifest中添加权限之后仍报错
Caused by: java.lang.SecurityException: getLine1NumberForDisplay: Neither user 10289 nor current process has android.permission.READ_PHONE_STATE, android.permission.READ_SMS, or android.permission.READ_PHONE_NUMBERS
错误详情不变
选择动态添加权限
public void requestAllPower() {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.READ_SMS,
Manifest.permission.READ_PHONE_NUMBERS,
Manifest.permission.READ_PHONE_STATE}, 1);
}