ionic-team / ionic-team/capacitor-camera
[Bug]: `uri` is missing `file://` on Android
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 1
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 2
Description
### Current Behavior
On iOS the `uri` property starts with `file://`, on Android it does not.
### Expected Behavior
On Android the `uri` property should start with `file://`.
### Reproduction
```TS
const photo = await Camera.takePhoto({});
console.log(photo);
```
### Screenshots / Media
iOS:
Android:
### Environment Details
```Shell
OS version: Android 13
npx cap doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 8.5.0
@capacitor/core: 8.5.0
@capacitor/android: 8.5.0
@capacitor/ios: 8.5.0
Installed Dependencies:
@capacitor/core: 8.5.0
@capacitor/android: 8.5.0
@capacitor/cli: 8.5.0
@capacitor/ios: 8.5.0
[success] Android looking great! 👌
[success] iOS looking great! 👌
npm --version
11.17.0
node --version
v24.19.0
```
### Versions Affected
Tested on v8.2.2
### Platforms Affected
- [ ] iOS
- [x] Android
- [ ] Web
### Notes / Comments
Tested on a Pixel 4a running Android 13.
I'm using the following as a temporary workaround:
```TS
const photo = await Camera.takePhoto({});
const photoPath = photo.uri?.startsWith('file://') ? photo.uri : `file://${photo.uri}`;
```
Contributor guide
Research direction
Start at the Camera.takePhoto entry point and trace the Android implementation that produces the returned photo object, comparing its uri with the iOS behavior described in the issue. Done means Android photo results consistently include the file:// prefix; add or update a regression test if the existing test coverage provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100