fix(android): point ShareActivity at its real class, fixing share-to-app crash #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/share-activity-classname"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #17.
The manifest declared the share target as
com.ncwcom.slash.ShareActivity, but the classlives in the vendored rnshare library as
com.mattermost.rnshare.ShareActivity. No suchclass exists in the APK, so every share into the app from another app died immediately:
Introduced by
715ad89dc, which renamedcom.mattermost.*tocom.ncwcom.slashacross theAndroid manifest and caught this library class name along with the app's own. Upstream
declares
com.mattermost.rnshare.ShareActivityat this position.Scope
One line. Deliberately unchanged:
android:taskAffinity="com.ncwcom.slash.share"-- an affinity string, not a classreference, and correct as the app's own namespace.
MattermostShareImplcomparesgetCurrentActivityName()against the simple name"ShareActivity", so it is unaffected by the package change.share_extension/index.tsxmatches on the scene name'ShareActivity', likewiseunaffected.
Verification
Static: the declared class now matches the only
ShareActivityclass in the tree, and noother reference to
com.ncwcom.slash.ShareActivityremains (git grepis clean).Not yet verified on device -- this needs a build and a share from another app (share a photo
from the gallery, confirm the compose sheet opens instead of the app dying). Worth doing
before merge since the whole failure mode was a build-time/runtime class resolution gap that
static checks cannot fully close.
Found via the crash-reports channel: SM-S938U / Android 16, app v1.0.0+1, 2026-08-31.
The manifest declared the share target as com.ncwcom.slash.ShareActivity, but the class lives in the vendored rnshare library as com.mattermost.rnshare.ShareActivity. No such class exists in the APK, so every share into Slash Chat from another app died immediately with: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ncwcom.slash/com.ncwcom.slash.ShareActivity} Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ncwcom.slash.ShareActivity" Introduced by715ad89dc, which renamed com.mattermost.* -> com.ncwcom.slash across the Android manifest and caught this library class name along with the app's own. Upstream declares com.mattermost.rnshare.ShareActivity here. Only the class reference changes. android:taskAffinity stays as com.ncwcom.slash.share (an affinity string, not a class), and MattermostShareImpl compares getCurrentActivityName() against the simple name "ShareActivity", which is unaffected. Confirmed in the field on 2026-08-31 from an SM-S938U (Android 16) via the crash-reports channel.