Code Monkey home page Code Monkey logo

Comments (13)

nkurapati avatar nkurapati commented on July 16, 2024 1

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.

IgneButene avatar IgneButene commented on July 16, 2024

I have the same issue on my Samsung S9 Oreo 8.0.0

from cordova-plugin-image-resizer.

JoschkaSchulz avatar JoschkaSchulz commented on July 16, 2024

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.

nkurapati avatar nkurapati commented on July 16, 2024

May be.. I don't have android 9 so didn't checked.

from cordova-plugin-image-resizer.

JoschkaSchulz avatar JoschkaSchulz commented on July 16, 2024

I will check different android versions later the day.

from cordova-plugin-image-resizer.

nkurapati avatar nkurapati commented on July 16, 2024

from cordova-plugin-image-resizer.

crawft avatar crawft commented on July 16, 2024

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.

nkurapati avatar nkurapati commented on July 16, 2024

@JoschkaSchulz Any updates?

@crawft Permissions are looking good.

from cordova-plugin-image-resizer.

nkurapati avatar nkurapati commented on July 16, 2024

@JoschkaSchulz

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.

crawft avatar crawft commented on July 16, 2024

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.

JoschkaSchulz avatar JoschkaSchulz commented on July 16, 2024

@crawft would you be so kind to create a pull request? then we could fix that for everyone :)

from cordova-plugin-image-resizer.

jayordway avatar jayordway commented on July 16, 2024

I used the method that @crawft had given and created a PR for it.

from cordova-plugin-image-resizer.

shide1989 avatar shide1989 commented on July 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.