Giter Club home page Giter Club logo

Comments (11)

Lonami avatar Lonami commented on July 19, 2024 1

Haha okay thanks for the fix! I didn't know where else I should look to help out.

And I have to agree that the SD card write permission is quite annoying ;)

from simple-gallery.

Lonami avatar Lonami commented on July 19, 2024

See the crash log gist here. The path is something like /storage/sdcard1/photos/somefile.gif so I don't understand how that is an "Invalid URI".

Edit: Appending file:// when calling Utils.Companion.getFileDocument doesn't avoid the error either.
Edit2: Config.newInstance(this).getTreeUri() returns "" (empty string). Is this meant to happen?

from simple-gallery.

tibbi avatar tibbi commented on July 19, 2024

Hey, thanks for the report and the gist! It should be fixed with the next version 1.30. The invalid URI is not the one of your file, its related to that ridiculously stupid Android 5+ new SD card write permission.

from simple-gallery.

Lonami avatar Lonami commented on July 19, 2024

Not so fast @tibbi, for some reason it still doesn't ask me for SD card permission and fails in the same place (trying with your latest commit).

I even cleared app data, uninstalled, and restarted phone (Android does weird stuff with the write permissions after rebooting; I've also had some issues with this and OpenCamera, where I need to re-ask manually after rebooting).

Also tried renaming the folder. You guessed it, same result, it also crashes, and never asks for permission. But not asking for permission should perhaps be a different issue.

from simple-gallery.

tibbi avatar tibbi commented on July 19, 2024

maybe the SD card path is not detected properly. Can you please check at the beginning of deleteItem(File file), which of the conditions is not true? One of these:
!file.canWrite()
Config.newInstance(activity).treeUri.isEmpty()

from simple-gallery.

Lonami avatar Lonami commented on July 19, 2024

Yes, I was exactly checking those three from isShowingWritePermissions, but I don't know how the heck I log something on the console in Kotlin! Hold on.

from simple-gallery.

Lonami avatar Lonami commented on July 19, 2024

file.canWrite() returns true, so it does not enter the condition. Maybe you should use || instead && (at least for the canWrite and treeUri.isEmpty() part, which is the one missing)?

Edit: Yes, the condition as return if (needsStupidWritePermissions(activity, file.absolutePath) && !file.canWrite() || Config.newInstance(activity).treeUri.isEmpty()) seems to work (althought it opened many, many pop-ups asking for selecting the SD card!).

from simple-gallery.

Lonami avatar Lonami commented on July 19, 2024

I think the reason for it to show so many pops up is that, after I click "OK, I'll select the SD card" the dialog closes, and thus it opens another one (because it's still trying to delete more files I assume).

from simple-gallery.

tibbi avatar tibbi commented on July 19, 2024

okay cool, thanks a lot. I dont feel like messing around with it even more, should be good enough.

from simple-gallery.

Lonami avatar Lonami commented on July 19, 2024

Everything working @tibbi. When renaming it only shows the pop up once if you click outside (to cancel), but when deleting the whole folder, a second dialog pops up (with one element in the folder). Still, the problem is fixed and this only happens once!

from simple-gallery.

tibbi avatar tibbi commented on July 19, 2024

ok thanks :) Thats good enough, I dont want to spend more time with it.

from simple-gallery.

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.