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

Adguard doesn't launch at startup, and if I do it manually it closes no matter what #5314

Closed
Roccobot opened this issue May 11, 2024 · 28 comments

Comments

@Roccobot
Copy link

Recently I noticed a behavior change in Adguard. It used to just work and it was completely transparent to me: it did its work silently and efficiently, I barely needed to see its UI.

Since some weeks, the app doesn't launch with the system anymore, which is per se annoying. But also, if I launch it manually, it doesn't keep running. Battery optimization disabled, persistent notification active, still no way to keep it running in the background.

Any help would be appreciated, thanks!

Device: Realme GT Master
Android 13
Adguard 4.3.199

@maxikuzmin
Copy link

@Roccobot I understood correctly that you have AdGuard version 4.3.199 installed for a long time, and after some time AdGuard stopped autorunning? So the build has been the same all this time and hasn't changed?

But also, if I launch it manually, it doesn't keep running.

What do you mean? You enable protection - the switch on the Home tab turns green, but ads are not blocked?

@Roccobot
Copy link
Author

Roccobot commented May 13, 2024

No, sorry if I explained myself poorly.

I never needed to launch Adguard after switching on the phone. It launched at startup by itself, and it worked flawlessly, blocking everything according to my rules.

Now, even though I don't know since when and why, the app doesn't start with the phone anymore. I can manually launch Adguard like any other app (by tapping its icon), and as soon as I do it the protection is enabled. But after a while (usually minutes) I see ads and stuff appearing again and I notice that Adguard is not running anymore, even though I disabled battery optimization and I have persistent notifications on.

@maxikuzmin
Copy link

@Roccobot strange behavior, I tested this on my Android 13 but it doesn't repeat.
It would be nice to get your logs.

Enable debug logging:

  • Settings -> General -> Advanced -> Logging level -> Debug

  • Reproduce the issue, then remember the exact time when it happened

  • Collect logs:

Settings -> General -> Advanced -> Export logs and system info

mention the 5314 number in the subject
specify the exact time when the issue occurred

@Roccobot
Copy link
Author

Roccobot commented May 13, 2024

debug log sent 🤞🏻🍀

@bbernardini
Copy link

If I may interject, I'm having the exact same issue as Roccobot. Running 4.4 Nightly 46 and Android 14.

@Roccobot
Copy link
Author

Any news? The app has become nearly unusable 😔

@bbernardini
Copy link

I have a log saved, but I only have a rough idea of the time the error happened. Is there a particular string I should look for that would indicate when protection was turned off?

@Roccobot
Copy link
Author

Roccobot commented May 18, 2024

I have a log saved, but I only have a rough idea of the time the error happened. Is there a particular string I should look for that would indicate when protection was turned off?

No idea, honestly, I can't understand logs. Meanwhile, I tried two alternative DNS-based solutions and they share the same exact issue. Might be an Android 13 thing, but there must be some workaround to let an app keep running no matter what, as long as you disable battery optimizations 🤔

@Roccobot
Copy link
Author

Anyway, the most common pattern might be that the app gets closed when the phone stays with the screen off for a while (like 30 minutes or more).

@maxikuzmin
Copy link

@bbernardini do you have a Realme device too?

@bbernardini
Copy link

@bbernardini do you have a Realme device too?

I do not. I have a Galaxy S21 Ultra.

@Roccobot
Copy link
Author

Roccobot commented May 22, 2024

Meanwhile, I checked a whole bunch of things (permissions and options) and I can add more info.
• I locked the Adguard app in the app switcher (Screenshot).
• I gave the app permission to launch at startup and run in background; I also disabled the option to stop the app if inactive (Screenshot).
• I had already disabled the 'battery optimization' before my original post.

Note: my UI is in Italian so I added translations, but they might not exactly match the English strings.

Now I basically solved the issue of Adguard not being launched at the OS startup, but on the other hand it keeps closing as described and I need to manually relaunch it 50 times a day (almost every time I pick my phone up from my pocket).

@maxikuzmin
Copy link

@Roccobot as far as we know Realme has a restriction on autorun not more than 5 applications, most likely this is the problem, we are still looking into it

@timpro2007
Copy link

timpro2007 commented May 22, 2024

@Roccobot @bbernardini @NUser2018
You are not alone ) I have the same problem "Adguard doesn't launch at startup" even with version 4.3.1 (Honor 8, Android 7), but at least after manual start of Adguard (once per day) v.4.3.1 works fine.
Warning - v 4.4 may be a complete disaster for some phones, it doesn't work at all (in fact).

@Roccobot
Copy link
Author

Would it be safe to downgrade to something like 4.2 until a fix is released?

@NUser2018
Copy link

Would it be safe to downgrade to something like 4.2 until a fix is released?

@Roccobot

Why not? Why don't you try it as a temporary solution if you have the opportunity and desire? If anything, the old versions can be downloaded here on GitHub at the link below, but of course, without much need, you should not use too old versions as well as unreleased, test, beta versions. If anything, please excuse me because I hardly speak English and use an online translator to read and write such messages.

https://github.com/AdguardTeam/AdguardForAndroid/releases

@Roccobot
Copy link
Author

Actually, I think I figured it out! Too bad every Android flavor treats background process in a different way. Digging deep into Battery settings, I found out Realme has three different kinds/'levels' of 'standby', meaning what happens when the screen stays off for a while. I changed it to the medium level and now it looks it works as it used to! 🤞🏻🍀

@NUser2018
Copy link

@Roccobot

Have you managed to solve your problems with the work of AdGuard? Congratulations! Could you clarify something for me here? Do you mean settings like those shown in my screenshot below? What kind of regime did you have? Ultra standby mode? And now what mode has been set? Balanced mode? Did you set the Ultra standby mode manually yourself? What for? After all, Balanced mode is selected by default. Too harsh a mode for optimizing the background operation of the entire device with the screen off can affect not only the operation of AdGuard, but also the operation of other applications. But as you can see, I have always had the default Balanced mode set, but unfortunately this does not help solve my problem with autorun of the new version 4.4, I do not have any problems with the background work of AdGuard.
Screenshot_2024-05-23-20-01-33-71_0ba066473b79d6e213a1f6f52505e2ee

@NUser2018
Copy link

@Roccobot

Are you writing about version 4.3.1 (4.3.199)? Have you tried the new version 4.4? I don't even know if you should do this. After all, if there are much fewer users with problems with version 4.3.1, then both I and other users have been complaining about version 4.4 here on GitHub in recent days.

@Roccobot
Copy link
Author

I'm talking about 4.4 and yes, @NUser2018 it's that option!
But I also did all the other things I mentioned before (battery optimization off, background run authorization, etc.)

@NUser2018
Copy link

NUser2018 commented May 24, 2024

@Roccobot

Hmm, so you have no problems with the automatic launch of AdGuard 4.4 when you turn on/restart the device!? Congratulations, and unfortunately I have such a problem (readme C25S, Android 13). Are you currently using the version of AdGuard 4.4 (4.4.184) or 4.4.1 (4.4.189), which was released yesterday on the update release channel?

@Roccobot
Copy link
Author

I updated to 4.4.1 and still OK

@NUser2018
Copy link

NUser2018 commented May 24, 2024

@Roccobot

It's clear. Thank you for your answers. Congratulations!

@Roccobot
Copy link
Author

Roccobot commented May 24, 2024

The disappointing thing here is that maybe Adguard can develop workarounds of some sort, but as far as I understood this definitely just depends on how different Android vendors implement their 'keep alive in background' thing. There might be Android variants where having the current version of Adguard always active is actually impossible 😐

@NUser2018
Copy link

@Roccobot

No, the fact that the user must additionally manually configure Android settings in the smartphone settings for the AdGuard application for autorun and battery consumption for its successful stable operation in the background is normal, it is extremely unlikely that this can be completely eliminated, especially for such a serious application as AdGuard, which is designed to filter Internet traffic constantly in the including in the background. I think there can be no questions for the AdGuard team at all. Moreover, if the user himself changes the default settings of his smartphone in the direction of tightening, which directly affect the operation of the device, system and all applications. It is much worse when the user has done all this and correctly configured what needs to be additionally configured manually and did not touch those settings that it is better not to touch, but at the same time the user has problems with AdGuard, especially if they did not exist before and AdGuard worked correctly on an older version, here the user already has there is every reason to contact the AdGuard support service and/or here via GitHub directly to the AdGuard team and hope that his problem will be considered and resolved as soon as possible. However, in this case, the user should still treat this with understanding, since there are a huge number of different devices and firmware for them in the world, which have long been not pure Android from Google, since each manufacturer itself reworks the original platform for its specific device. Therefore, of course, the developers and the rest of the AdGuard team, like any other developers of other software, cannot guarantee that absolutely all users are completely insured against the possibility of certain problems in the operation of the device and /or certain applications. But of course, users who have encountered certain problems can also be understood, they wait, believe and hope that their problems will be considered and resolved as soon as possible. And it's great when, in addition to contacting the official support service, there is also the opportunity in one way or another (for example, here via GitHub) to interact more quickly and more directly with the AdGuard team or some other software.

Thank you again for your messages here. I wish you good luck. If anything, write more.

@maxikuzmin maxikuzmin assigned Versty and unassigned maxikuzmin May 27, 2024
@maxikuzmin
Copy link

@bbernardini @NUser2018 @timpro2007 you mentioned version 4.2 in this issue. Is autorun working correctly in version 4.2?

@NUser2018
Copy link

NUser2018 commented May 27, 2024

@maxikuzmin

As far as I can see, version 4.2 was mentioned in this task only in the sense that the user @Roccobot wanted to try to switch to it, since he had problems even in version 4.3.1 (4.3.199), but if you read the entire chain of messages here to the end, then later it becomes clear that in the end this user solved his problem by changes to the settings of your smartphone and as a result, now even version 4.4 works fine. Unfortunately, this cannot be said about my case, which is considered in another task. And on version 4.3 (and on version 4.2 as far as I remember too) I had no problems with AdGuard automatically starting when I turned on/rebooted the device. As far as I remember the last time (and it's the first time, because before that I didn't use AdGuard on a smartphone, since I didn't have a smartphone at all :)) I had a similar problem with AdGuard autorun on the release version 3.6.11 (the second number, which is shown in Android, it seems to have 3.6.54). Then, with the release of the global new 4.X line and the transition to it, the problem with AdGuard autorun disappeared for me, but unfortunately it has returned now with the release of version 4.4. In addition, I am not sure that my problem has common causes with the problems of those users who wrote something here in this task in English, in addition, it is not very convenient for me to communicate in English because I do not actually know it and I use an online translator to write and read such messages, therefore it would be more convenient for me to consider and discuss my problem in a separate task (#5328), which I opened initially and in Russian. I will be waiting for news and questions from you in that task and I will be glad to help you in studying and solving this problem as much as I can. Here, of course, along the way, other users with similar problems are already writing in both tasks, and not only those who opened these tasks initially, but as far as I understand, users have the most problems and complaints about version 4.4.

@Versty
Copy link
Contributor

Versty commented May 28, 2024

@Roccobot You are absolutely right in #5314 (comment), autostart and background app operation varies greatly from one Android vendor to another. I'm glad you've found a set of system settings that allow AdGuard to start and run in the background with no issues.

If the issue reappears for some reason, please continue in #5328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants