Open arabnology opened 8 months ago
@arabnology Need more than just that.
The exact platform in which it was made.
@arabnology Need more than just that.
The exact platform in which it was made.
That's all what i got in the log section.
Tested on Android 14 and iOS 17
@override
void initState() {
super.initState();
WakelockPlus.enable(); //enable screen wakelock.
}
@override
void dispose() {
super.dispose();
WakelockPlus.disable(); //disable screen wakelock.
}
The code above called in the first screen after app initialization complete.
App initialization code(Main function):
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await SystemChrome.setPreferredOrientations(const [
DeviceOrientation.portraitUp,
]);
//Other code...
}
Wont' work for me.
Galaxy S23, API 34, Java 17, latest dart and flutter.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter (14135): #0 WakelockPlusApi.toggle (package:wakelock_plus_platform_interface/messages.g.dart:100:7)
E/flutter (14135):
@arabnology and @corepuncher, what I would suggest is to first run flutter clean
, then flutter pub upgrade
so that it upgrades any transitive dependencies that wakelock_plus
uses. This is usually the case when upgrading to breaking library versions. I've had this happen to me recently when upgrading Flutter versions, where I would forget to run flutter pub upgrade
so that it upgrades any Flutter based transitive dependencies that support the latest version.
Right now, I'm unable to reproduce this in the example app, especially when running it on my personal Google Pixel 7 running Android 14. Keep in mind that I also ran flutter clean
and flutter pub upgrade
so that it would have everything good and ready when running the example app.
@arabnology and @corepuncher, looks like I spoke too soon. Turns out, when I released version 1.2.0
, it was using an older version of wakelock_plus_platform_interface
that was not published beforehand, where I did make changes. As a result, the example app for some reason was using the local version, which didn't have these issues.
Bottom line, it worked fine on the example app because it re-routed wakelock_plus_platform_interface
back to the local version. Chalk it up to good old-fashioned confirmation bias.
As a result, released wakelock_plus_platform_interface
version 1.2.0
and subsequently released wakelock_plus
version 1.2.1
which uses the aforementioned updated version.
I'm using version 1.2.1 and the same problem is occurring.
@arabnology and @corepuncher, looks like I spoke too soon. Turns out, when I released version
1.2.0
, it was using an older version ofwakelock_plus_platform_interface
that was not published beforehand, where I did make changes. As a result, the example app for some reason was using the local version, which didn't have these issues.Bottom line, it worked fine on the example app because it re-routed
wakelock_plus_platform_interface
back to the local version. Chalk it up to good old-fashioned confirmation bias.As a result, released
wakelock_plus_platform_interface
version1.2.0
and subsequently releasedwakelock_plus
version1.2.1
which uses the aforementioned updated version.
1.21 fixed the issue for me.
For me the following error is presented. This started to occur after generating a new flutter project in version 3.9.15.
For me the following error is presented. This started to occur after generating a new flutter project in version 3.9.15.
Error
You need to be using at least Flutter 3.19
or higher.
Try that first, since that's the minimum version that you need going forward.
For me the following error is presented. This started to occur after generating a new flutter project in version 3.9.15. Error
You need to be using at least Flutter
3.19
or higher.Try that first, since that's the minimum version that you need going forward.
Oh sorry. I wrote wrong. I am using version 3.19.5. (Channel stable, 3.19.5, on macOS 14.3.1 23D60 darwin-arm64, locale pt-BR).
Have you tried creating a new flutter project and running wakelockplus on it?
@fabiomicheldossantos yup, I see what you mean now.
Looks like the upgrades to the Android integration broke due to it forcing a much higher Kotlin version that what people usually use.
Nevertheless, it's now straightened out once you build using Java 17 and Android Gradle Plugin 8.3.x.
Expect a PR very shortly.
@fabiomicheldossantos published version 1.2.2
which brings the Android integration in line with the rest of the plus_plugins
.
Good morning, @diegotori! I tested it here and it worked! There was only a conflict with the parse_server_sdk_flutter package because of package_info_plus, but I resolved this by overwriting the package_info_plus package to version 6.0.0. Thank you very much for your attention. God bless you!
I have this problem, even if I use 1.1.1 I have the same problem. I get it not only on android but also on ios.
`[log] #0 WakelockPlusApi.toggle (package:wakelock_plus_platform_interface/messages.g.dart:124:7)
@kalismeras61 I would upgrade to 1.2.2
, which solves a bunch of issues related to pigeon.
Due to other dependencies, I wasn't able to upgrade wakelock_plus
to the latest and was still running into this issue.
Putting my fix here in case anyone else is in a similar situation. I had to lock to the matching version of wakelock_plus_platform_interface
by adding it to my own pubspec.yaml (if not, a pub upgrade would move it to the broken version which would break things):
wakelock_plus: 1.1.4
wakelock_plus_platform_interface: 1.1.0
Hi @diegotori, I also get this exception using version 1.2.4, both on Android and iOS:
messages.g.dart in WakelockPlusApi.toggle at line 124 within wakelock_plus_platform_interface
In App
<asynchronous suspension>
method_channel_wakelock_plus.dart in MethodChannelWakelockPlus.toggle at line 20 within wakelock_plus_platform_interface
It doesn't happen all the time, only in some instances.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) -0 WakelockPlusApi.toggle (package:wakelock_plus_platform_interface/messages.g.dart:100:7)