Comments (8)
Have you set the following permissions in your AndroidManifest.xml?
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
If so, are you able to reproduce the same error on the example app in the example/
folder of this repo?
from media.
Yes, I have those permissions in the android/app AndroidManifest.xml (first screenshot).
When it comes to the example/
folder, I encountered two problems:
Module not found: Error: Can't resolve '@capacitor-community/media' in '/Users/francesco.delgiudice/Downloads/media-master/example/src/components'
in the terminal onionic cap sync android
(second screenshot)Caused by: org.gradle.api.resources.MissingResourceException: Could not read script '/Users/francesco.delgiudice/Downloads/media-master/example/android/capacitor-cordova-android-plugins/cordova.variables.gradle' as it does not exist.
in Android Studio while builiding/running the app (third screenshot).
Am I missing something?
from media.
Run npm install
and npm run build
in the root directory first, and then go to the example directory and run npm install
and ionic cap sync
.
from media.
Oh ok, I didn't know I had to build the root directory and I didn't read it in the README.
Anyway, the example
folder works flawlessly but as shown in the screenshot I'm using the methods in the same way so I don't understand what I am doing wrong.
The first time I try to save it asks the user for permission and, even if granted, it doesn't save the image.
The second time it does save the image (since now it has the permissions to do it) but crashes (maybe tries to follow through and show the folder like in your example
folder) or sometimes it doesn't crash but doesn't follow through, simply saving the image.
Do you have maybe other tips?
from media.
Media.createAlbum()
does not return an album object, so that part of your code might be causing issues. You have to getAlbums() after creating an album. Let me know what the behavior is after that, and share your new code, and we can go from there.
from media.
This is the code right now. It seems to be working sometimes (so a little bit better than before I guess) but the console.log aren't working so I am still confused
from media.
Honestly, this code looks fine, so I'm not sure. However, this is almost certainly a problem with your specific configuration, since I've tested this on multiple devices and the emulator and it works. If you can share a minimal reproducible example in a repo (minimal app with the bug), I can debug this directly. (Or if you've already fixed it, or moved on, please let me know!)
from media.
I couldn't find a bug and it still didn't work so clearly something in the configuration isn't working properly but I can't manage to find it since everything else works. At a certain point I gave up and found a different way to download the images without using a library. Thanks anyway
from media.
Related Issues (20)
- 199131008-c2327514-8987-4535-b377-41dbed6a8e52.png (1302×540)https://github.com/orgs/community/discussions/35791
- Type in your language with Gboard
- Error while copying media file HOT 10
- Media.savePhoto's Promise<PhotoResponse> returns 'undefined' on iOS HOT 2
- Read file path from platform-specific identifier on iOS HOT 1
- docs(android): make it clear that file return on savePhoto is only available on Android
- App is crashed on Android due to EACCES (Permission denied) HOT 11
- Is there any method to retrieve more photos like using offset in query? HOT 1
- feat(android): add getAlbumsPath() function to get where albums are stored on filesystem
- Error: RuntimeException occurred : In SaveVideo method HOT 1
- READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are still required in Android 13 HOT 5
- RuntimeException occurred / EACCES (Permission denied) when trying to save a photo/gif/video on android < 13 HOT 12
- When wanting to save photo to Album with identifier, getting identifier doesnt exist even tho Album exist HOT 3
- feat(ios): support jpeg files instead of png HOT 3
- Camera plugin is not implement on Android (Capacitor Camera) when pairing with Capacitor-Community/Media HOT 2
- savePhoto is not working in android 8.1.0 Samsung SM-T580 tablet HOT 1
- MediaFetchOptions support individual photo for high resolution HOT 2
- feat(ios): get specific media by identifier HOT 9
- feat: has access right / error codes for all errors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.