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
Google maps not showing always in Safari browser #116969
Comments
Hi @raman-kumar-ha In case the issue still persists, please provide a completed and minimal reproducible code sample so that we may verify this. Thanks! |
@huycozy Hi, Yes i already updated to latest version but still the issue is there |
@raman-kumar-ha Thanks for trying the latest version. Please also provide a completed and minimal reproducible code sample so that we may verify this. |
Hi @huycozy BaseLocation.dart build method
Scaffold(
|
@raman-kumar-ha Also, you may try running google_maps_flutter/example on your Safari to check if the issue still persists or not. Thank you! |
@huycozy Hi , did you try my code? |
@raman-kumar-ha Your sample code is containing dependencies and is not complete/minimal to reproduce the issue. Please double-check my previous comment where you can find the plugin example that you can try with it. |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. |
Okay i am going to post the relavent code |
@raman-kumar-ha As I suggested above, you may try running google_maps_flutter/example on your Safari to check if the issue still persists or not. |
@huycozy Yes i am gonna try it and will update here. |
@huycozy Hi, issue video link Steps:-
|
Hi @raman-kumar-ha Screen.Recording.2023-02-09.at.18.58.52.mov |
@huycozy can you just use my sample code in your project, also open the screen from button click so that you can open it again and check the issue? |
@raman-kumar-ha It's loading fine with below sample code after I adding the page navigation. I can see the grey color loading but it's only displayed immediately. Screen.Recording.2023-02-10.at.19.15.58.movSample codeimport 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
void main() {
runApp(
MaterialApp(
title: 'Named Routes Demo',
// Start the app with the "/" named route. In this case, the app starts
// on the FirstScreen widget.
initialRoute: '/',
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/': (context) => const FirstScreen(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/second': (context) => const MapSample(),
},
),
);
}
class FirstScreen extends StatelessWidget {
const FirstScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('First Screen'),
),
body: Center(
child: ElevatedButton(
// Within the `FirstScreen` widget
onPressed: () {
// Navigate to the second screen using a named route.
Navigator.pushNamed(context, '/second');
},
child: const Text('Launch screen'),
),
),
);
}
}
class MapSample extends StatefulWidget {
const MapSample({Key? key}) : super(key: key);
@override
State<MapSample> createState() => MapSampleState();
}
class MapSampleState extends State<MapSample> {
final Completer<GoogleMapController> _controller =
Completer<GoogleMapController>();
static const CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
static const CameraPosition _kLake = CameraPosition(
bearing: 192.8334901395799,
target: LatLng(37.43296265331129, -122.08832357078792),
tilt: 59.440717697143555,
zoom: 19.151926040649414);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () => Navigator.of(context).pop(),
),
title: Text('Sample'),
actions: <Widget>[],
),
body: GoogleMap(
mapType: MapType.hybrid,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
floatingActionButton: FloatingActionButton.extended(
onPressed: _goToTheLake,
label: const Text('To the lake!'),
icon: const Icon(Icons.directions_boat),
),
),
);
}
Future<void> _goToTheLake() async {
final GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newCameraPosition(_kLake));
}
} |
@huycozy did you try coming back to map screen again and again , it is working fine ? No grey screen found? |
@raman-kumar-ha Thanks for pointing out that. Issue investigation
Demo
✅: No Issue ❌: Issue reproduced Error logsError from backend:
Error: Bad state: Not connected to an application.
Stack Trace:
#0 DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:272:13)
#1 _rootRunUnary (dart:async/zone.dart:1406:47)
#2 _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#3 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#4 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#5 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#6 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#7 _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
#8 _rootRunUnary (dart:async/zone.dart:1414:13)
#9 _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#10 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#11 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#12 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#13 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#14 _StreamController._add (dart:async/stream_controller.dart:648:7)
#15 _StreamController.add (dart:async/stream_controller.dart:596:5)
#16 new WebSocketImpl.fromSocket.<anonymous closure> (package:web_socket_channel/src/copy/web_socket_impl.dart:730:21)
#17 _rootRunUnary (dart:async/zone.dart:1406:47)
#18 _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#19 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#20 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#21 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#22 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#23 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#24 _WebSocketProtocolTransformer._messageFrameEnd (package:web_socket_channel/src/copy/web_socket_impl.dart:319:23)
#25 _WebSocketProtocolTransformer.add (package:web_socket_channel/src/copy/web_socket_impl.dart:218:46)
#26 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#27 _rootRunUnary (dart:async/zone.dart:1406:47)
#28 _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#29 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#30 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#31 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#32 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#33 _StreamController._add (dart:async/stream_controller.dart:648:7)
#34 _StreamController.add (dart:async/stream_controller.dart:596:5)
#35 _Socket._onData (dart:io-patch/socket_patch.dart:2353:41)
#36 _rootRunUnary (dart:async/zone.dart:1414:13)
#37 _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#38 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#39 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#40 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#41 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#42 _StreamController._add (dart:async/stream_controller.dart:648:7)
#43 _StreamController.add (dart:async/stream_controller.dart:596:5)
#44 new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1871:33)
#45 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1328:14)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#48 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:123:13)
#49 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5) Sample codeimport 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
void main() {
runApp(
MaterialApp(
title: 'Named Routes Demo',
// Start the app with the "/" named route. In this case, the app starts
// on the FirstScreen widget.
initialRoute: '/',
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/': (context) => const FirstScreen(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/second': (context) => const MapSample(),
},
),
);
}
class FirstScreen extends StatelessWidget {
const FirstScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('First Screen'),
),
body: Center(
child: ElevatedButton(
// Within the `FirstScreen` widget
onPressed: () {
// Navigate to the second screen using a named route.
Navigator.pushNamed(context, '/second');
},
child: const Text('Launch screen'),
),
),
);
}
}
class MapSample extends StatefulWidget {
const MapSample({Key? key}) : super(key: key);
@override
State<MapSample> createState() => MapSampleState();
}
class MapSampleState extends State<MapSample> {
final Completer<GoogleMapController> _controller =
Completer<GoogleMapController>();
static const CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
static const CameraPosition _kLake = CameraPosition(
bearing: 192.8334901395799,
target: LatLng(37.43296265331129, -122.08832357078792),
tilt: 59.440717697143555,
zoom: 19.151926040649414);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () => Navigator.of(context).pop(),
),
title: Text('Sample'),
actions: <Widget>[],
),
body: GoogleMap(
mapType: MapType.hybrid,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
floatingActionButton: FloatingActionButton.extended(
onPressed: _goToTheLake,
label: const Text('To the lake!'),
icon: const Icon(Icons.directions_boat),
),
),
);
}
Future<void> _goToTheLake() async {
final GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newCameraPosition(_kLake));
}
} flutter doctor -v (stable and master)[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
• Flutter version 3.7.3 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9944297138 (17 hours ago), 2023-02-08 15:46:04 -0800
• Engine revision 248290d6d5
• Dart version 2.19.2
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Users/huynq/Library/Java/JavaVirtualMachines/corretto-1.8.0_302/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment Corretto-8.302.08.1 (build 1.8.0_302-b08)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.75.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 13 (API 33)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.77
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
[!] Flutter (Channel master, 3.8.0-12.0.pre.49, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
• Flutter version 3.8.0-12.0.pre.49 on channel master at /Users/huynq/Documents/GitHub/flutter_master
! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b08cc8be79 (45 minutes ago), 2023-02-13 22:36:26 -0500
• Engine revision c4f51bc786
• Dart version 3.0.0 (build 3.0.0-233.0.dev)
• DevTools version 2.21.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.75.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.96
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category. |
/cc @ditman FYI |
This is odd, note that the map is rendering the warning that "This page can't load Google Maps correctly." without problems. I've only seen this issue when the google maps attempts to render in a 0x0/invisible div. There seems to be a race condition with the navigation and the rendering of the map widget (or maybe it's because we're caching an old one). Unsure! I'll take a look though! |
Screen.Recording.2022-12-13.at.4.mp4
google_maps_flutter: ^2.1.12
[✓] Flutter (Channel stable, 3.3.4, on macOS 12.5 21G72 darwin-arm, locale en-IN)
• Flutter version 3.3.4 on channel stable at /Users/admin/Documents/flutter_sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86e (10 weeks ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/admin/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.5 21G72 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.98
[✓] HTTP Host Availability
• All required HTTP hosts are available
The text was updated successfully, but these errors were encountered: