deadobjectexception

GetPackageInfo results in DeadObjectException

隐身守侯 提交于 2021-02-07 19:54:35
问题 I have the following code snippet: public static String getAppVersion(Context context) { String versionName = null; try { versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; //This is the problematic line } catch (NameNotFoundException e) { e.printStackTrace(); } return versionName; } Now according to Crashlytics, there was a case when the app crashed giving the following exception: Caused by android.os.DeadObjectException com.tawkon.data.lib