Closed cu1tur4l closed 2 years ago
and doesn't have 6 fucking trackers in a wallpaper app XD. Haha yeah totally :-D
Hum, that is super odd. What happens if you open yourself the theme and wallpaper app, and from there set the app as wallpaper? It should short circuit the "open the theme app" part. Though I suspect something different is happening.
I don't think you are doing something wrong, there are some issues that started to randomly pop up with android 12 and some launchers: Like, on Samsung, with android 12, the app would start to crash because Samsung started to assume that some ressources it ask from the app where like bitmap images, when I was using vector assets. And they would not do any verifications. So I believe something bad is also happening in the vivo v21 launcher. Let me look up online if other live wallpapers have similar issues with live wallpapers then.
Found this stacktrace on the google play console for some crashes on vivo v21xx phones:
java.lang.IllegalStateException:
at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded (LifecycleRegistry.java:39)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent (LifecycleRegistry.java:2)
at net.redwarp.gifwallpaper.GifWallpaperService$GifEngine.onCreate (GifWallpaperService.java:76)
at android.service.wallpaper.WallpaperService$Engine.attach (WallpaperService.java:1365)
at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage (WallpaperService.java:2235)
at com.android.internal.os.HandlerCaller$MyHandler.handleMessage (HandlerCaller.java:44)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:233)
at android.os.Looper.loop (Looper.java:334)
at android.os.HandlerThread.run (HandlerThread.java:67)
What happens if you open yourself the theme and wallpaper app, and from there set the app as wallpaper? It should short circuit the "open the theme app" part.
I'm not sure I understand, you want me to open themes app and select your app as a, let's say, default wallpaper app? If so I don't think it's possible. I can't even open the themes app. It opens only when you want to change the wallpaper, I think it's purpouse is to show you how your new wallpaper will look on your screen before you change it.
In theory, if you long press on your home screen in any area with no icon under your click, you should see an option to change the wallpaper. You can then choose any image, or a live wallpaper such as "gif live wallpaper".
Unfortunately I cannot, or I am to stupid to do it. If i long press, choose "wallpaper" I can choose from built-in wallpapers, and I have 3 dots at the end. These dots open the same sets of built-in wallpapers and an ability to open gallery to choose the file i want to set as an wallpaper. Thats all I can do :/
Interesting, I don't think you are dumb, every phone is different! I'll have some time tomorrow to investigate the stack trace, maybe I'll figure something out!
Thank you very much! There is no rush, I "lived" with static wallpapers for all these years so I can wait a little bit more :) Thanks for trying to help me tho!
@cu1tur4l I think I might have a fix! Not sure exactly if it works though, as I can't reproduce your issue, but I pushed it on the branch https://github.com/redwarp/gif-wallpaper/tree/fix_crash_lifecycle.
Could you maybe download this debug APK and tells me if it works?: https://drive.google.com/file/d/1s8mzyE3G7bO1Btm-WWkX7pO_cWnHWrsR/view?usp=sharing (Yeah, I know, downloading random files from strangers on the internet is not the best)
It's signed with the debug certificate, meaning that you would first need to uninstall the legit version of the app, before you can install that one (otherwise, conflict)
If that fixed it, I'll push it to the main, and make a new release.
@redwarp Sadly :( it didn't fix anything :( It still launches the "loading live wallpaper" (the "check how the wallpaper looks on your screen") screen. I have two options there, "settings" or "apply", "apply" does nothing, because there is no wallpaper to set and when I click "settings" I can go and pick gif through your app. When I go back, or just go to home screen, nothing changes. The "loading live wallpaper" screen still (infinitely) "loads" the wallpaper and the wallpaper does not appear on the home screen.
Thanks for trying it! Damn it, it's a hard one to crack :'(
Well I don't think it will be much help, because the app is not open source, but maybe? I dunno. The app I was talking about earlier is this (catchy name btw). Just trying to help somehow :/
I don't remember exactly how it is in the app, but after picking the gif I'd like to use, the app switches to "loading live wallpaper" screen, and you have to wait there for couple of seconds till the gif loads, and then you can set it as an wallpaper. I've tried waiting with your app too, but sadly its stuck there forever if(forever=60s).
Edit: Well I don't think I added anything new to the mix, you probably knew how it should work. Well, thats very "trying to help somehow" of me.
Haha can't blame them for the name, I am pretty sure they were there first :-) The "trying to help" part is great, any info is good to take! I'll check again in the google console to see if I see more crash reports I can use, or try to see if there are some emulator online for your phone where I can try the app. My main problem is still that I can't reproduce. As an android dev, I have a Google phone (pixel), and they work in most cases. It's cool as a user, but I don't see most of the bugs that happen on other phones :-P
Haha can't blame them for the name, I am pretty sure they were there first :-) The more you know 😨
Anyways, if I can help anyhow, feel free to ask. Btw you know is there any way that using adb may help? If so I know that wouldn't be permanent fix, but workaround at least. Oh and maybe "adb'ing" on my end may be any help to you? I used it with scrcpy and to uninstall/disable some apps, and that's the only thing it does for me :D, so maybe it is useless in this case.
Here is a second debug apk: https://drive.google.com/file/d/1AeifIah00bdEfI8BAAU7Y0ujcJyHC6VA/view?usp=sharing I hope this helps!
For adb, it could help I guess if you can see the app crashing, (not simply not working, just crashing), and use adb's logcat to capture the crash trace? See https://developer.android.com/studio/command-line/logcat
But I hope this new version works for you, it tries to change the signal that are supposed to start, pause the gifs, hopefully it's better.
Same thing :( I also noticed some continuity(?) I mean, as I installed/uninstalled the app several times now, I noticed that when you launch it for the first time, the "live wallpaper" screen appears, I click settings, choose gif, and then when I go back to the "loading live wallpaper" screen the app crashes. But it crashes only then, like when i repeat the procedure (clear gif, stop app, launch, select, back) nothing happens. It stays open, no crashes.
I don't know it is any help, but when I go through the first crash, and relaunch the app, it "works" as it should (I mean, i used it earlier so I remember how it was). It still does not change the wallpaper, but when I launch it I get the "GIF Activate" button (from your app), that redirects me again to your app. But then there is no "loading live wallpaper" screen. I mean it is still there, when I go back from screen with 'open gif' 'change scale' 'rotate' etc. I'm again at it, but it still loads infinitely.
I will try understanding the logcat you suggested, or if you know step by step what should I do, please respond with it, I think it will be faster this way :) Either way I will try it.
I also think that I found something new, but maybe - because you typed:
You can then choose any image, or a live wallpaper such as "gif live wallpaper".
it actually works as it should. I will screen record it so the explanation will be easier, but for now: I launch the app, everything is ok, I click "GIF Activate" button, I get redirected to "themes" app (with the 'loading live wallpaper' screen) then I click "settings" and at this point, I thought I should be back in your app, because I can see the "Open GIF" "Change scale" buttons, but when I check the recently used apps (I mean, when I click the 3rd button on the bottom of your screen), I'm still in the "themes" app.
I don't know what I'm doing, I tried to do adb logcat -f filename, did not work, and tried to do adb logcat INFO, but it surely is not how this thing works. So after thinking, I'm too stupid, I want the results fast, I simply launched adb logcat, waited for the wall of text to 'stop', fiddle with your app, and copy everything to notepad++ to check whats going on. Again, I don't know what I'm doing but words "FATAL EXCEPTION" are not good, I guess. The first thing that I found:
03-31 20:11:28.461 14662 14690 W OpenGLRenderer: Surface doesn't have any previously queued frames, nothing to readback from
03-31 20:11:28.465 14662 14680 E AndroidRuntime: FATAL EXCEPTION: WallpaperService
03-31 20:11:28.465 14662 14680 E AndroidRuntime: Process: net.redwarp.gifwallpaper, PID: 14662
03-31 20:11:28.465 14662 14680 E AndroidRuntime: java.lang.IllegalStateException: Method handleLifecycleEvent must be called on the main thread
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:317)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:133)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher$DispatchRunnable.run(EngineLifecycleDispatcher.kt:66)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher.postDispatchRunnable(EngineLifecycleDispatcher.kt:34)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher.onStop(EngineLifecycleDispatcher.kt:49)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at net.redwarp.gifwallpaper.GifWallpaperService$GifEngine.onVisibilityChanged(GifWallpaperService.kt:115)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:1265)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:1353)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:2202)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:233)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.os.Looper.loop(Looper.java:334)
03-31 20:11:28.465 14662 14680 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
Interesting!!! Your stacktrace actually helps, I can see thanks to that that you are indeed using the debug version I send you, and that my changes did nothing :-D I have an idea, let me try something.
It also displays this:
03-31 20:10:59.850 14497 14519 D libMEOW : meow new tls: 0xb400007b853f8070
03-31 20:10:59.850 14497 14519 D libMEOW : applied 0 plugin for [net.redwarp.gifwallpaper].
A lot of times. (with different 'tls' numbers).
I also have this:
03-31 20:13:35.176 15077 15077 V GraphicsEnvironment: ANGLE Developer option for 'net.redwarp.gifwallpaper' set to: 'default'
03-31 20:13:35.177 15077 15077 V GraphicsEnvironment: App is not on the allowlist for updatable production driver.
I don't know if you are here so I don't want to edit the first message if you alreade red it, but just before the FATAL EXCEPTION, is this:
03-31 20:11:28.438 14662 14680 D libMEOW : meow new tls: 0xb400007b853f8070
03-31 20:11:28.438 14662 14680 D libMEOW : meow reload base cfg path: na
03-31 20:11:28.438 14662 14680 D libMEOW : meow reload overlay cfg path: na
03-31 20:11:28.438 14662 14680 D libMEOW : applied 0 plugin for [net.redwarp.gifwallpaper].
03-31 20:11:28.451 14662 14680 V WallpaperService: Setting wallpaper dimming: 0
03-31 20:11:28.453 14662 14680 I BufferQueueConsumer: [](id:394600000000,api:0,p:-1,c:14662) connect: controlledByApp=false
03-31 20:11:28.454 14662 14680 I BLASTBufferQueue: [Wallpaper#0] constructor()
03-31 20:11:28.457 14662 14680 D GifWallpaper: Surface created.
And I believe that these things are the last ones that have "gifwallpaper" or "redwarp" in the message.
03-31 20:12:53.771 1443 1486 I ActivityTaskManager: Displayed net.redwarp.gifwallpaper/.SetupActivity: +532ms
03-31 20:12:31.792 14709 14709 V ImeFocusController: checkFocus: view=DecorView@fed1810[SetupActivity] next=DecorView@fed1810[SetupActivity] force=true package=net.redwarp.gifwallpaper
03-31 20:11:56.358 8497 8497 D Documents: shouldRestrictStorageAccessFramework = true, packageName = net.redwarp.gifwallpaper
03-31 20:11:46.570 1443 1486 I ActivityTaskManager: Displayed net.redwarp.gifwallpaper/.SetupActivity: +567ms
So, I have now two candidate apk for you! (Thanks for bearing with me):
I'm curious if any (or both) would work on your device!
(Thanks for bearing with me):
With you? Haha, look at my constant edits and not a single clue what I'm doing. Thank you, I will test them right now.
Edit About editing...
For me it's a bit like a puzzle :-D A really annoying puzzle, but a puzzle still! Must... fix... things...
Both did not work. Should I only give you the Fatal Exception part? Or do you also need something else?
Damn! The fatal exception would be great yeah
The "gif_mail_looper"
03-31 20:43:05.339 17538 17645 E AndroidRuntime: FATAL EXCEPTION: WallpaperService
03-31 20:43:05.339 17538 17645 E AndroidRuntime: Process: net.redwarp.gifwallpaper, PID: 17538
03-31 20:43:05.339 17538 17645 E AndroidRuntime: java.lang.IllegalStateException: Method handleLifecycleEvent must be called on the main thread
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:317)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:133)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher$DispatchRunnable.run(EngineLifecycleDispatcher.kt:66)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher.postDispatchRunnable(EngineLifecycleDispatcher.kt:34)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher.onStop(EngineLifecycleDispatcher.kt:49)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at net.redwarp.gifwallpaper.GifWallpaperService$GifEngine.onVisibilityChanged(GifWallpaperService.kt:115)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:1265)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:1353)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:2202)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:233)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.os.Looper.loop(Looper.java:334)
03-31 20:43:05.339 17538 17645 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
The "gif_unsafe" (scary name btw)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: FATAL EXCEPTION: WallpaperService
03-31 20:45:54.039 18538 18555 E AndroidRuntime: Process: net.redwarp.gifwallpaper, PID: 18538
03-31 20:45:54.039 18538 18555 E AndroidRuntime: java.lang.IllegalStateException: Method handleLifecycleEvent must be called on the main thread
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:317)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:133)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher$DispatchRunnable.run(EngineLifecycleDispatcher.kt:66)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher.postDispatchRunnable(EngineLifecycleDispatcher.kt:34)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at net.redwarp.gifwallpaper.EngineLifecycleDispatcher.onStop(EngineLifecycleDispatcher.kt:49)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at net.redwarp.gifwallpaper.GifWallpaperService$GifEngine.onVisibilityChanged(GifWallpaperService.kt:115)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:1265)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:1353)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:2202)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:233)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.os.Looper.loop(Looper.java:334)
03-31 20:45:54.039 18538 18555 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
Edit. Oh, they are both the same I think :D
That is odd, I think that either I gave you the wrong link, or you might be on the wrong apk? I mean, especially with the "unsafe" one, the check that write in the logcat the java.lang.IllegalStateException: Method handleLifecycleEvent must be called on the main thread
should actually not be called, meaning it can't crash
Hm, I don't know. I'm sure that I'm using the correct files. I'm also uninstalling the app every time. Guide me?
Let me regenerate those again! I might have messed things up.
I also found string(?) I don't know how to name it, but in these logs I searched only for "gifwallpaper" or "redwarp" and there is also this thing: "rp.gifwallpape". You think it will be usefull?
So, here is a link to a google drive folder with two apks: https://drive.google.com/drive/folders/1wtGyYT4z2PnSNpyHnjnoExzSrp_Fi_VH?usp=sharing
They are smaller because these are actually release build, instead of debug build. But at last I know for sure that they are new and fresh. Let me know if you see the same behavior (=crash with the same FATAL Exception). Especially for the unsafe, it should not. I mean, it might crash, but with a different message.
Not sure yet if I need more logs, I think the one you provide already help narrow the issue.
Ok, last thing because it confused me:
03-31 20:43:00.661 15710 15710 I PackageManagerReceiver: unsupported action: android.intent.action.PACKAGE_CHANGED Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:net.redwarp.gifwallpaper flg=0x5000010 cmp=org.fdroid.fdroid/.receiver.PackageManagerReceiver (has extras) }
This log was from the mail_looper, but I left th adb logcat open while I was instaling it. Edit. It confused me because it has "fdroid" in itself.
Btw, can I narrow the logs just to what I need to see? I mean I'm sure I can, it is more like; Can you tell me how I can do it?
It is working!!! Main_looper crashes, but unsafe.apk is working!
What to do now?
Coool! Well, now, I'll update the app with the unsafe change (It's not really unsafe to be honest, it's scary but it's just bypassing the thread check, which is okay because wallpaper are background service anyway). It will take a few days for it to be published on the Google Play Store, and probably a week for F-droid (the automated tools on F-droid that release new versions are not really fast.)
So in the meantime, you probably should keep the version that work. For all intents and purposes, it's a release build, so it's like the real deal. The only difference are the "signatures", which means that you won't be able to auto-update the app when there is a new release, but will have to manually uninstall your version, then reinstall it from f-droid when it's available.
About signatures: Basically, when you make an app, you "sign" it with some unique identifier. When there is an update, your phone verifies that the signature of the new app is the same of the old app. If it's different, it's shady, so the install will not happen. I self signed the apk I send you, so the signature is my on, instead of being the F-droid one, of the Google play store one.
I hope its clear :-D
Release done: https://github.com/redwarp/gif-wallpaper/releases/tag/v1.13.1 It's now building the google play version. F-droid will pick it up when they pick it up! (that is out of my hands)
I think now it works as you wanted to. When I click "GIF Activate" in your app it redirects me to "loading live wallpaper" and it loads... Your app! And then when I click settings, I can change everything, and changes do apply. I cleared gif and did it again, everything is good, going back does not go back to "loading live wallpaper", it just closes the app (the wallpaper is still set).
When I was typing, you replied. Thanks, it is! Thank you so much for helping. the fact that I can use gif as a wallpaper is so cool. I'm using t-ui launcher as my home screen so it looks amazing. Check this out.
Thank you again, and one more thing: could you add a button to, I don't know how to describe it, like "center" it horizontaly but without it moving up or down? I mean you have to be pixel perfect to slide down the gif and not move it left or right.
Now that I think about it, screenshoting the gif is not the best idea to show how cool it is. Here's the gif.
That's a cool one! I usually roll with stuff from waneella, I really love their art (https://www.waneella.com/)
So, about adding new functions or buttons: I'm kind of reluctant to do so, as, I want to keep the app as simple as possible, so the less buttons the happier I am.
Plus, the app is now translated in 7 languages I think! Always by random people of the internet! But every time I add a function, then I need to source the translations as well :-P
Cheers and thanks for being patient!
Oh my! These are amazing, I once saw one of these but didnt know they have so much of them! Well now thanks again! They sure are amazing.
I'm on F-Droid version, tested it on the Google Store version - did not work either. I'm using Vivo V21, today they enrolled Android 12 update and the app is not working anymore. I also tested other app that does "the same" thing and it worked, but yours is better for me, and doesnt have 6 fucking trackers in a wallpaper app XD.
After testing the other app I think that the problem lies in the fact that your app first launches the "Themes" app which changes my wallpaper, and then launches itself with the image I select. When your app opens "themes" app, it just shows black screen with "loading animated wallpaper", but it never loads. I can click "settings" on the bottom, and then I'm in your app when I can choose the gif and everything, but after choosing it, I can't apply it, if I go back, your app crashes. Or maybe im just doing something wrong, either way, send help pls.