Skip to content

fix(android): improve error handling for external storage file access#14442

Merged
FabianLars merged 5 commits intotauri-apps:devfrom
ish1416:fix/android-external-files-access
Jan 20, 2026
Merged

fix(android): improve error handling for external storage file access#14442
FabianLars merged 5 commits intotauri-apps:devfrom
ish1416:fix/android-external-files-access

Conversation

@ish1416
Copy link
Copy Markdown
Contributor

@ish1416 ish1416 commented Nov 10, 2025

Fixes 500 error when accessing local video files in Android external storage directory via convertFileSrc. Added better error handling and logging for Android external storage access to help diagnose permission and accessibility issues.

Closes #14432

  • Enhanced Android-specific error handling in asset protocol handler
  • Added file existence checks before attempting to open files
  • Added detailed logging for debugging Android external storage access
  • Improved error messages with specific guidance for storage permissions
  • Added changelog entry in .changes directory

- Add better error handling and logging for Android external storage paths
- Provide more descriptive error messages when file access fails
- Check file existence and permissions before attempting to open files
- Helps diagnose issues with accessing files in /storage/emulated/0/Android/data/ paths

Fixes tauri-apps#14432
@ish1416 ish1416 requested a review from a team as a code owner November 10, 2025 04:50
@github-project-automation github-project-automation Bot moved this to 📬Proposal in Roadmap Nov 10, 2025
@ish1416
Copy link
Copy Markdown
Contributor Author

ish1416 commented Nov 10, 2025

@FabianLars Can you review this PR?

Copy link
Copy Markdown
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pr :) a few ideas since most of your code should offer value on other platforms as well, not just android.

Comment thread crates/tauri/src/protocol/asset.rs Outdated
Comment thread crates/tauri/src/protocol/asset.rs Outdated
Comment thread crates/tauri/src/protocol/asset.rs Outdated
Comment thread crates/tauri/src/protocol/asset.rs Outdated
Comment thread crates/tauri/src/protocol/asset.rs Outdated
@ish1416
Copy link
Copy Markdown
Contributor Author

ish1416 commented Nov 10, 2025

@FabianLars Thanks for the review . Ill use your suggestions!

- Make file existence and metadata checks platform-agnostic (not Android-only)
- Remove verbose debug logging that doesn't add value
- Simplify error messages to reduce spam
- Keep Android-specific context only where necessary
@ish1416
Copy link
Copy Markdown
Contributor Author

ish1416 commented Nov 10, 2025

@FabianLars Ive changed in the latest commits whats have been asked can you review it now?

@ish1416 ish1416 requested a review from FabianLars November 12, 2025 03:34
Comment thread crates/tauri/src/protocol/asset.rs Outdated
Use 422 Unprocessable Entity instead of 500 Internal Server Error
for metadata access failures, as it's more semantically correct.
The file exists and path is valid, but can't be processed due to
metadata access issues (permissions, locks, etc.).
@ish1416 ish1416 force-pushed the fix/android-external-files-access branch from 8de9d9b to ea3a242 Compare November 26, 2025 11:47
@github-actions
Copy link
Copy Markdown
Contributor

Package Changes Through d1db071

There are 9 changes which include tauri with minor, tauri-utils with patch, tauri-build with patch, tauri-cli with minor, tauri-macos-sign with patch, @tauri-apps/cli with minor, tauri-bundler with minor, tauri-runtime-wry with minor, tauri-runtime with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.8.1 2.8.2
tauri-macos-sign 2.3.2 2.3.3
tauri-bundler 2.7.5 2.8.0
tauri-runtime 2.9.2 2.10.0
tauri-runtime-wry 2.9.3 2.10.0
tauri-codegen 2.5.2 2.5.3
tauri-macros 2.5.2 2.5.3
tauri-plugin 2.5.2 2.5.3
tauri-build 2.5.3 2.5.4
tauri 2.9.5 2.10.0
@tauri-apps/cli 2.9.6 2.10.0
tauri-cli 2.9.6 2.10.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars FabianLars merged commit 853ed46 into tauri-apps:dev Jan 20, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from 📬Proposal to 🔎 In audit in Roadmap Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

[bug] 500 Error when trying to access local video on android

2 participants