Comments (13)
I see a fix here, but its still not working for me. Please update if you see fix in this.
https://stackoverflow.com/questions/46489706/android-oreo-api-26-create-dir-in-external-storage
from cordova-plugin-image-resizer.
I have the same issue on my Samsung S9 Oreo 8.0.0
from cordova-plugin-image-resizer.
hrm... I will try to find out more... I tried it on a android 9 device and it works without problems... maybe the problems are just appear in 8?
from cordova-plugin-image-resizer.
May be.. I don't have android 9 so didn't checked.
from cordova-plugin-image-resizer.
I will check different android versions later the day.
from cordova-plugin-image-resizer.
from cordova-plugin-image-resizer.
Same here, 8.1.
I've never worked with native Android code but it looks like folder.mkdir(); must be failing, then you don't check the result of saveFile (which is null after mkdir fails).
Something to do with permissions?
from cordova-plugin-image-resizer.
@JoschkaSchulz Any updates?
@crawft Permissions are looking good.
from cordova-plugin-image-resizer.
I have debugged the code and its failing to create folder at line no#115: success = folder.mkdir(). So saveFile function is returning null and scaledFile.toString() is failing at line no#61.
I have tested line no#110 as follows, but still same error.
- folder = new File(Environment.getExternalStorageDirectory() + "/" + folderName);
- folder = new File(Environment.getExternalStorageDirectory(), folderName);
I have following permissions:
uses-sdk android:minSdkVersion="16"
uses-permission android:name="android.permission.INTERNET"
uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
uses-feature android:name="android.hardware.location.gps"
uses-permission android:name="android.permission.RECORD_AUDIO"
preference name="AndroidPersistentFileLocation" value="Internal"
preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root"
Please let me know if I am missing anything.
from cordova-plugin-image-resizer.
I worked around this by changing the code around line 129 as follows, this creates the resized image in a private folder so may not work if you want the image elsewhere (though maybe you could just copy it after or something).
Context context = this.cordova.getActivity().getApplicationContext();
folder = context.getDir(folderName, context.MODE_PRIVATE);
from cordova-plugin-image-resizer.
@crawft would you be so kind to create a pull request? then we could fix that for everyone :)
from cordova-plugin-image-resizer.
I used the method that @crawft had given and created a PR for it.
from cordova-plugin-image-resizer.
any news on this Topic ? the branch was merged in 2018 and this issue isn't closed.
i'm still having the issue on Android 29
from cordova-plugin-image-resizer.
Related Issues (20)
- Please add the fileName(String) option for IOS too. Currently it only supports android and windows HOT 2
- Image proportion HOT 2
- Mismatch in ID/Package name causing double addition of plugin to package.json HOT 2
- Build failing (Unknown property `ANDROID_EXIFINTERFACES_VERSION`) HOT 18
- Nested FolderName throwing exception HOT 2
- fileName parameter on iOS does not work the way it is documented? HOT 7
- Always execute the error function
- Build failure HOT 4
- Short on Time HOT 1
- build failed Could not find exifinterface.jar HOT 4
- Failed to resize an image on iOS 12.x HOT 1
- Android giving black background for transparent Images HOT 1
- Failed to fetch plugin HOT 5
- IOS gives back an empty base64 string
- Version 0.2 isn't avaliable in NPM HOT 3
- base64: true not work in Android, returns file:/// uri scheme HOT 4
- Anyone got this working using cordova-plugin-camera-preview
- Code executes synchronously. Android HOT 2
- rotating camera captured photo by -90 degree and when selected from galary HOT 1
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 cordova-plugin-image-resizer.