From 2e92530cd3e4daec9ad1e273e08802822d7d263b Mon Sep 17 00:00:00 2001 From: Alexander Harding Date: Thu, 12 Dec 2024 12:02:58 -0600 Subject: [PATCH] fix(android): Subsequent build crash with missing version data Resolves #7802 --- android/capacitor/src/main/java/com/getcapacitor/Bridge.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java index dd623ae65..868253537 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java @@ -416,7 +416,7 @@ private boolean isNewBinary() { PackageManager pm = getContext().getPackageManager(); PackageInfo pInfo = InternalUtils.getPackageInfo(pm, getContext().getPackageName()); versionCode = Integer.toString((int) PackageInfoCompat.getLongVersionCode(pInfo)); - versionName = pInfo.versionName; + if (pInfo.versionName != null) versionName = pInfo.versionName; } catch (Exception ex) { Logger.error("Unable to get package info", ex); }