wakelock
wakelock copied to clipboard
Wakelock doesn't work at the latest version of flutter
Our flutter app closed although we are using Wakelock package at the latest version of flutter . the old version is working normally. Could you support me?
For now, I just use:
dependency_overrides:
win32: 3.1.4
because that was the dependency that was causing issues.
We still need an update of wakelock, because we need win32: 5.0.3 and wakelock requires win32 ^2.0.0 or ^3.0.0
I am having this problem and I don't know what to do
We have also encountered the same issue
Also this part will be an issue since Flutter 3.10 uses Dart >=3.
environment:
sdk: '>=2.12.0 <3.0.0'
For a temporary workaround, I have forked the repo and upgraded the dependency constraints. If you want to use it until an official update is available:
dependency_overrides:
wakelock_windows:
git:
url: [email protected]:formigas/wakelock.git
path: wakelock_windows/
ref: main
dependencies:
wakelock:
git:
url: [email protected]:formigas/wakelock.git
path: wakelock/
ref: main
Also created this as a PR: https://github.com/creativecreatorormaybenot/wakelock/pull/213
@martin-formigas The project I am working on is not using wakelock directly but some of the packages we have are using it. How can I use your fork to overcome this? I tried the above suggested solution
dependency_overrides:
win32: 3.1.4
But it gave errors on pub get.
@aytunch you can override it even when it is only a transitive dependency. Just use dependency_overrides
instead of dependencies
.
dependency_overrides:
wakelock:
git:
url: [email protected]:formigas/wakelock.git
path: wakelock/
ref: main
Hi @Goddchen thanks for the info.
This is what I added to my pubspec.yaml and I get the below error.
If I downgrade the pod_player
to 0.0.6, then I can do pub get but app crashes when wakelock is used in the podplayer package with the new Flutter 3.10.5.
Can I solve this by dependency_overrides
magic?
environment:
sdk: '>=3.0.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
flutter_inappwebview: ^6.0.0-beta.22
# https://pub.dev/packages/pod_player
pod_player: ^0.1.5
dependency_overrides:
wakelock:
git:
url: [email protected]:formigas/wakelock.git
path: wakelock/
ref: main
wakelock_windows:
git:
url: [email protected]:formigas/wakelock.git
path: wakelock_windows/
ref: main
Resolving dependencies...
Because every version of core from path depends on package_info_plus ^4.0.2 and no versions of package_info_plus match >4.0.2 <5.0.0, every version of core from path requires package_info_plus 4.0.2.
And because package_info_plus 4.0.2 depends on win32 >=4.0.0 <6.0.0, every version of core from path requires win32 >=4.0.0 <6.0.0.
Because wakelock_windows >=0.2.1 depends on win32 ^3.0.0 and wakelock_windows <0.2.1 depends on win32 ^2.0.0, every version of wakelock_windows requires win32 ^2.0.0 or ^3.0.0.
Thus, core from path is incompatible with wakelock_windows.
And because pod_player >=0.1.1 depends on wakelock ^0.6.2 which depends on wakelock_windows ^0.2.0, core from path is incompatible with pod_player >=0.1.1.
So, because insurance depends on both pod_player ^0.1.5 and core from path, version solving failed.
exit code 1
Moreover, I don't see wakelock_windows
in my pubspec.lock files. This is the generated lock: (I am testing on mobile and Web, windows is not important for me)
wakelock:
dependency: transitive
description:
name: wakelock
sha256: "78bad4822be81d37e7bc34b6990da7dface2a445255cd37c6f053b51a4ccdb3b"
url: "https://pub.dev"
source: hosted
version: "0.4.0"
wakelock_macos:
dependency: transitive
description:
name: wakelock_macos
sha256: "73581e5d9ed2dd1ba951375c30e63f0eb8c58d7d6286ae9ddf927b88f2aea8d9"
url: "https://pub.dev"
source: hosted
version: "0.1.0+3"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
sha256: d0a8a1c02af68077db5df1e0f5e2b745f7b1f2cdcc48e3e0b6f8f4dcc349050e
url: "https://pub.dev"
source: hosted
version: "0.2.1+3"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
sha256: "06b0033d5421712138e7fa482ff5c6280fe12e0a41c40c3fe8fda2c007eb4348"
url: "https://pub.dev"
source: hosted
version: "0.2.0+3"
@aytunch hm strange, the And because pod_player >=0.1.1 depends on wakelock ^0.6.2
and the dependency_overrides
for wakelock
existing at the same time doesn't make real sense to me. Sorry, I have no idea how that could happen or how to solve it.
Will be there a new version soon? Somehow, the dependency override is not working anymore
@thomasklaush by looking at the frequency of updates on this package, we might need to wait a while (not a criticism to the maintainer, we all have stuff going on).
My recommendation to anyone looking for a reliable solution would be to download the package locally, make all the package updates you require and override the reference on your app's pubspec to point at your local folder, that's what I have done until this package gets an update, this way you don't rely on other people's repositories.
I'll upload in the next few hours my version in a ZIP file for anyone that wants to use it locally.
Sorry the delay, here it is:
place the file at the same level as your project folder (1 level up from your pubspec.yaml)
then edit your pubspec.yaml reference like:
wakelock:
path: ../wakelock-main/wakelock
I also have an override for win32
as follows:
dependency_overrides:
win32: ^5.0.2
I'm not sure if you'll need this win32
override though
Hope it helps
Sorry the delay, here it is:
place the file at the same level as your project folder (1 level up from your pubspec.yaml)
then edit your pubspec.yaml reference like:
wakelock: path: ../wakelock-main/wakelock
I also have an override for
win32
as follows:dependency_overrides: win32: ^5.0.2
I'm not sure if you'll need this
win32
override thoughHope it helps
Thank you, worked well without the override.
Consider switching to https://pub.dev/packages/wakelock_plus Published by fluttercommunity.dev
It is a continuation of this project, so there shouldn't be any issues.
Consider switching to https://pub.dev/packages/wakelock_plus Published by fluttercommunity.dev
It is a continuation of this project as the owner is not able to work on it at the moment afaik.
I will soon discontinue this repository. Please use wakelock_plus: ^1.1.6 instead.