Skip to content

fix(android): replace GuardedResultAsyncTask with AsyncTask for RN 0.85+#995

Open
ukarpenkov wants to merge 2 commits into
react-native-documents:mainfrom
ukarpenkov:fix/rn-85-guarded-result-async-task
Open

fix(android): replace GuardedResultAsyncTask with AsyncTask for RN 0.85+#995
ukarpenkov wants to merge 2 commits into
react-native-documents:mainfrom
ukarpenkov:fix/rn-85-guarded-result-async-task

Conversation

@ukarpenkov
Copy link
Copy Markdown

Summary

GuardedResultAsyncTask was removed from React Native in the New Architecture (0.76+). This PR replaces it with the standard android.os.AsyncTask to restore Android build compatibility with RN 0.85+.

Changes

  • Replace GuardedResultAsyncTask<ReadableArray> with AsyncTask<Void, Void, ReadableArray>
  • Remove super(reactContext.getExceptionHandler()) call
  • Rename doInBackgroundGuarded()doInBackground()
  • Rename onPostExecuteGuarded()onPostExecute()

Error fixed

error: cannot find symbol
import com.facebook.react.bridge.GuardedResultAsyncTask;
                                ^
  symbol:   class GuardedResultAsyncTask

Test plan

  • Tested on RN 0.85.3 — Android build succeeds
  • Document picking works correctly on emulator (API 35)

GuardedResultAsyncTask was removed from React Native in the New
Architecture (0.76+). Replace it with standard android.os.AsyncTask
to restore Android build compatibility with RN 0.85+.

Changes:
- Replace GuardedResultAsyncTask<ReadableArray> with AsyncTask<Void, Void, ReadableArray>
- Remove super(reactContext.getExceptionHandler()) call
- Rename doInBackgroundGuarded() → doInBackground()
- Rename onPostExecuteGuarded() → onPostExecute()
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

⚠️ No Changeset found

Latest commit: e16f5b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant