babincc / flutter_workshop

This repo houses add-ons, plug-ins, and helpful code to make Flutter programming easier.
5 stars 1 forks source link

Errors running example app on iOS #22

Open esDotDev opened 2 months ago

esDotDev commented 2 months ago

The example app throws a couple errors on iOS.

After pressing "Discover Bridges" which calls BridgeDiscoveryRepo.discoverBridges

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SocketException: Send failed (OS Error: No route to host, errno = 65), address = 0.0.0.0, port = 5353
#0      _NativeSocket.send (dart:io-patch/socket_patch.dart:1269:34)
#1      _RawDatagramSocket.send (dart:io-patch/socket_patch.dart:2584:15)
#2      MDnsClient.lookup (package:multicast_dns/multicast_dns.dart:219:22)
#3      BridgeDiscoveryService.discoverBridgesMdns (package:flutter_hue/domain/services/bridge_discovery_service.dart:23:54)
<asynchronous suspension>
#4      BridgeDiscoveryRepo.discoverBridges (package:flutter_hue/domain/repos/bridge_discovery_repo.dart:62:25)
<asynchronous suspension>
#5      _HomePageState.discoverBridges (package:example/main.dart:336:28)

Despite the error, sometimes the bridges do seem to be discovered.

Then, when pressing "Fetch Network" which calls HueNetwork.fetchAll we get:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter_hue/domain/models/light/light_timed_effects.dart': Failed assertion: line 17 pos 16: 'Validators.isValidValue(effect, effectValues)': `effectValues` does not contain ""
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      new LightTimedEffects (package:flutter_hue/domain/models/light/light_timed_effects.dart:17:16)
#3      new LightTimedEffects.fromJson (package:flutter_hue/domain/models/light/light_timed_effects.dart:30:12)
#4      new Light.fromJson (package:flutter_hue/domain/models/light/light.dart:106:39)
#5      HueNetwork.fetchAllType (package:flutter_hue/domain/models/hue_network.dart:378:31)
<asynchronous suspension>
#6      HueNetwork.fetchAll (package:flutter_hue/domain/models/hue_network.dart:309:7)
babincc commented 1 month ago

I do most of my testing on iOS, and I have not run into these. Could you answer a few questions so I can know where to start looking for the issue?

  1. Will a hot restart, or completely stopping the simulation and starting it again, fix the issue?
  2. Are you testing on an older version of iOS or emulated device?
  3. What Flutter version are you using?
  4. Are you using any non-Hue branded smart products?