fix(android): point ShareActivity at its real class, fixing share-to-app crash #21

Merged
mohlec merged 1 commit from fix/share-activity-classname into ncw/main 2026-09-01 17:04:58 +00:00
Owner

Fixes #17.

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 the app from another app died immediately:

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 by 715ad89dc, which renamed com.mattermost.* to 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 at this position.

Scope

One line. Deliberately unchanged:

  • android:taskAffinity="com.ncwcom.slash.share" -- an affinity string, not a class
    reference, and correct as the app's own namespace.
  • MattermostShareImpl compares getCurrentActivityName() against the simple name
    "ShareActivity", so it is unaffected by the package change.
  • share_extension/index.tsx matches on the scene name 'ShareActivity', likewise
    unaffected.

Verification

Static: the declared class now matches the only ShareActivity class in the tree, and no
other reference to com.ncwcom.slash.ShareActivity remains (git grep is 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.

Fixes #17. 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 the app from another app died immediately: ``` 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 by `715ad89dc`, which renamed `com.mattermost.*` to `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` at this position. ### Scope One line. Deliberately unchanged: - `android:taskAffinity="com.ncwcom.slash.share"` -- an affinity string, not a class reference, and correct as the app's own namespace. - `MattermostShareImpl` compares `getCurrentActivityName()` against the simple name `"ShareActivity"`, so it is unaffected by the package change. - `share_extension/index.tsx` matches on the scene name `'ShareActivity'`, likewise unaffected. ### Verification Static: the declared class now matches the only `ShareActivity` class in the tree, and no other reference to `com.ncwcom.slash.ShareActivity` remains (`git grep` is 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 by 715ad89dc, 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.
mohlec merged commit 034d42063e into ncw/main 2026-09-01 17:04:58 +00:00
mohlec deleted branch fix/share-activity-classname 2026-09-01 17:04:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slash/slash-mobile!21
No description provided.