Skip to content

Commit

Permalink
fix: development android crash on reinstall (#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Dec 13, 2024
1 parent 3194e3f commit 3764303
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
},
"patchedDependencies": {
"@capacitor/haptics": "patches/@[email protected]",
"@capacitor/keyboard": "patches/@[email protected]"
"@capacitor/keyboard": "patches/@[email protected]",
"@capacitor/android": "patches/@capacitor__android.patch"
},
"updateConfig": {
"ignoreDependencies": [
Expand Down
13 changes: 13 additions & 0 deletions patches/@capacitor__android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/capacitor/src/main/java/com/getcapacitor/Bridge.java b/capacitor/src/main/java/com/getcapacitor/Bridge.java
index 594146a0f8fc2903fd255c0b864db97d94ebfb1b..4f13ca78a4051e3b1bc5cd5d3de0e8a99aa44728 100644
--- a/capacitor/src/main/java/com/getcapacitor/Bridge.java
+++ b/capacitor/src/main/java/com/getcapacitor/Bridge.java
@@ -417,7 +417,7 @@ public class Bridge {
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);
}
7 changes: 5 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3764303

Please sign in to comment.