Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Folder selection not possible #114

Closed
3 tasks done
adamindo opened this issue Nov 18, 2024 · 16 comments
Closed
3 tasks done

[Bug] Folder selection not possible #114

adamindo opened this issue Nov 18, 2024 · 16 comments
Assignees
Labels
bug Something isn't working low priority This issue has low priority

Comments

@adamindo
Copy link

Confirmation

Bug Description

The Folder selection screen is empty after update to v6.0.0

Steps to Reproduce

During Setup (after update or fresh installation) open the folder selection.
The screen ist quiet empty, beside some buttons (cancel, select, and SD card).
/storage/emulated/0 is preselected an cannot be changed.

Trying to add/select a folder arfterward (via button instead of the setup screen) dies cause the same issue.

Expected Behavior

It is possible to select one or more directories as a source for pictures

Screenshots

Screenshot_20241118-174331_Peristyle

Device Information

Android Smartphone Shift6mq with ShiftOS based in Android 10 without Google services

Additional Context

No response

Sufficiency Confirmation

  • I have provided all the information requested above and deemed sufficient for the developer to address the issue
@adamindo adamindo added the bug Something isn't working label Nov 18, 2024
@Hamza417
Copy link
Owner

Was the storage permission granted to the app before opening folder selection?

@adamindo
Copy link
Author

adamindo commented Nov 18, 2024 via email

@Hamza417
Copy link
Owner

I checked and the folders are showing in my device. I also haven't changed anything in the folders screen since it was added in the app so it shouldn't just randomly break. Could you downgrade to the previous working version and let me know if it's working? You can start by v5.2.0.

@adamindo
Copy link
Author

adamindo commented Nov 18, 2024 via email

@Hamza417
Copy link
Owner

java.util.NoSuchElementException: Collection is empty.
at kotlin.collections.CollectionsKt.random(SourceFile:36)
at app.simple.peri.services.AutoWallpaperService.getHomeScreenWallpaper(SourceFile:251)
at app.simple.peri.services.AutoWallpaperService.access$setHomeScreenWallpaper(SourceFile:1)
at app.simple.peri.abstraction.AbstractComposeAutoWallpaperService$setComposeWallpaper$1.invokeSuspend(SourceFile:70)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
at kotlinx.coroutines.DispatchedTask.run(SourceFile:113)
at androidx.core.app.ActivityRecreator$1.run(SourceFile:12)
at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:96)

It occurred because there wasn't any file added in the database, it's a side effect of the current issue.

Did something change in your device recently or a new mod or anything that could affect the other apps? An AppOps controller can do something like that.

@Hamza417 Hamza417 added low priority This issue has low priority under investigation problem is being investigated or needs more information can't reproduce the problem cannot be reproduced labels Nov 19, 2024
@adamindo
Copy link
Author

Hello Hamza, sorry, I couldn't answer sooner.
Thank you for your quick responses and your efforts.

I'm currently running v4.0.0, which works fine for me.
Here I can use the setup screen an select my background folder. The folder Selektion screen looks like that.
Screenshot_20241120-214613_Peristyle

When I upgrade to 5.0.0 some issues come up and I can't use the folder selection screen anymore. Now I need to switch to the legacy UI. I don't get exception messages, but the automatic background switch becomes unreliable.

When I upgrade to 6.0.0 additionally the exception messages pop up as long as I do not switch to the legacy UI. But even with the legacy UI I can't set up the APP correctly and the automatic background switch is not working properly.

@Hamza417
Copy link
Owner

But even with the legacy UI I can't set up the APP correctly and the automatic background switch is not working properly.

You may need to clear your app data before switching to the legacy UI.

When I upgrade to 5.0.0 some issues come up and I can't use the folder selection screen anymore. Now I need to switch to the legacy UI. I don't get exception messages, but the automatic background switch becomes unreliable.

Yes, I changed the whole database framework in the v5.0.0 and moved away from Scoped Storage. The current implementation should work, but for some reason it's not working on your device. Could you upgrade to the latest version and generated logs of the app and send me the file? I'd recommend the complete system logs during the setup of the Peristyle app to see if something in your device blocking the app's access to the file system.

You can use this command to create the logs of the app: adb logcat -c && adb logcat > logs.txt

@adamindo
Copy link
Author

Can I send them to you on a less public way?

@Hamza417
Copy link
Owner

You can upload here.

@adamindo
Copy link
Author

adamindo commented Nov 22, 2024

I have created two log files, one for an installation of 4.0.0 and update to 6.0.0 and one with a new installation of 6.0.0.

@Hamza417
Copy link
Owner

Hamza417 commented Nov 22, 2024

Thanks for providing the logs, I checked and haven't found anything suspicious so far,

11-21 22:04:42.943  1449  1528 I ActivityTaskManager: Displayed app.simple.peri/.activities.main.PathChooserActivity: +57ms

The activity was opened, and no path is listed, but I did not find any traces of error after that.

11-21 22:04:56.709 28814 28838 W System.err: java.util.NoSuchElementException: Collection is empty.
11-21 22:04:56.709 28814 28838 W System.err: 	at kotlin.collections.CollectionsKt.random(SourceFile:36)
11-21 22:04:56.709 28814 28838 W System.err: 	at app.simple.peri.services.AutoWallpaperService.getHomeScreenWallpaper(SourceFile:251)
11-21 22:04:56.709 28814 28838 W System.err: 	at app.simple.peri.services.AutoWallpaperService.access$setHomeScreenWallpaper(SourceFile:1)
11-21 22:04:56.709 28814 28838 W System.err: 	at app.simple.peri.abstraction.AbstractComposeAutoWallpaperService$setComposeWallpaper$1.invokeSuspend(SourceFile:70)
11-21 22:04:56.709 28814 28838 W System.err: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
11-21 22:04:56.709 28814 28838 W System.err: 	at kotlinx.coroutines.DispatchedTask.run(SourceFile:113)
11-21 22:04:56.709 28814 28838 W System.err: 	at androidx.core.app.ActivityRecreator$1.run(SourceFile:12)
11-21 22:04:56.709 28814 28838 W System.err: 	at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
11-21 22:04:56.709 28814 28838 W System.err: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:96)

Later, The app crashes here, possibly because there is no entry in the database?. I think I might know what the problem could be. I'll get back to you once I get time to fix the issue and send you an APK for testing.

@adamindo
Copy link
Author

Thank you very much

@Hamza417
Copy link
Owner

image

I have managed to reproduce this problem in my emulator. I am working on a possible fixes now.

@Hamza417 Hamza417 removed the can't reproduce the problem cannot be reproduced label Nov 25, 2024
@Hamza417
Copy link
Owner

Hamza417 commented Nov 25, 2024

app-prod-release.zip

Please test this and let me know if your issue is resolved.

Edit: Do not forget to uninstall any previous builds before installing this one.

@adamindo
Copy link
Author

That looks awsome, thank you very much.
I'm able to select the folder and I'm running the APP now for some hours and it runs stable doing it's job. Great work.

@Hamza417
Copy link
Owner

I'm glad :)
It's a release build so you can continue using the same app. I'll publish a release soon for everyone else.

@Hamza417 Hamza417 removed the under investigation problem is being investigated or needs more information label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority This issue has low priority
Projects
None yet
Development

No branches or pull requests

2 participants