Unact / yandex_mapkit

Flutter implementation of YandexMapkit
MIT License
135 stars 148 forks source link

Screen issue #82

Closed soloroman closed 3 years ago

soloroman commented 3 years ago

flutter doctor -v results:

[✓] Flutter (Channel master, 1.26.0-2.0.pre.263, on Mac OS X 10.15.7 19H15 darwin-x64, locale ru-RU)
    • Flutter version 1.26.0-2.0.pre.263 at /Users/soloroman/flutter
    • Framework revision 4606a69b0f (17 hours ago), 2021-01-08 16:44:20 -0500
    • Engine revision 9cb4d2dd24
    • Dart version 2.12.0 (build 2.12.0-204.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/soloroman/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/soloroman/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (4 available)
    • sdk gphone x86 (mobile) • emulator-5554                        • android-x86    • Android 11 (API 30) (emulator)
    • iPhone 11 (mobile)      • 91F7DE73-2DA7-49E0-B24E-FEBFF85F3822 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
    • macOS (desktop)         • macos                                • darwin-x64     • Mac OS X 10.15.7 19H15 darwin-x64
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 87.0.4280.141

• No issues found!

lib/main.dart contents:

import 'package:flutter/material.dart';
import 'package:yandex_mapkit/yandex_mapkit.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  YandexMapController controller;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: YandexMap(
            onMapCreated: (YandexMapController yandexMapController) {       // also tried async, but there is error.
              controller = yandexMapController;
              controller.toggleNightMode(enabled: true);      // await controller.toggleNightMode(enabled: true);
            },
            onMapTap: (Point point) =>
                print('Tapped map at ${point.latitude},${point.longitude}'),
            onMapLongTap: (Point point) => print(
                'Long tapped map at ${point.latitude},${point.longitude}')
        )
    );
  }
}

without async and await result is and app keeps crash:

W/PlatformViewsController(22887): Creating a virtual display of size: [1080, 2148] may result in problems(https://github.com/flutter/flutter/issues/2897).It is larger than the device screen size: [1080, 1977].
W/yandex.maps(22887): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps(22887): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
W/Gralloc4(22887): allocator 3.x is not supported
W/yandex.maps(22887): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps(22887): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
E/AndroidRuntime(22887): FATAL EXCEPTION: main
E/AndroidRuntime(22887): Process: ru.soloroman.vrum_app, PID: 22887
E/AndroidRuntime(22887): java.lang.AbstractMethodError: abstract method "void io.flutter.plugin.platform.PlatformView.onFlutterViewAttached(android.view.View)"
E/AndroidRuntime(22887):    at io.flutter.plugin.platform.VirtualDisplayController.onFlutterViewAttached(VirtualDisplayController.java:181)
E/AndroidRuntime(22887):    at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:233)
E/AndroidRuntime(22887):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime(22887):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime(22887):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime(22887):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime(22887):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738)
E/AndroidRuntime(22887):    at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(22887):    at android.os.MessageQueue.next(MessageQueue.java:335)
E/AndroidRuntime(22887):    at android.os.Looper.loop(Looper.java:183)
E/AndroidRuntime(22887):    at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(22887):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(22887):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(22887):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
W/System  (22887): A resource failed to call release.
W/yandex.maps(22887): decltype: Network reinitialization
W/yandex.maps(22887):
E/yandex.maps(22887): decltype: Request timed out
E/yandex.maps(22887):
Lost connection to device.

with async await:

W/PlatformViewsController(23323): Creating a virtual display of size: [1080, 2148] may result in problems(https://github.com/flutter/flutter/issues/2897).It is larger than the device screen size: [1080, 1977].
W/yandex.maps(23323): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps(23323): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
W/yandex.maps(23323): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps(23323): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
W/Gralloc4(23323): allocator 3.x is not supported
E/AndroidRuntime(23323): FATAL EXCEPTION: main
E/AndroidRuntime(23323): Process: ru.soloroman.vrum_app, PID: 23323
E/AndroidRuntime(23323): java.lang.AbstractMethodError: abstract method "void io.flutter.plugin.platform.PlatformView.onFlutterViewAttached(android.view.View)"
E/AndroidRuntime(23323):    at io.flutter.plugin.platform.VirtualDisplayController.onFlutterViewAttached(VirtualDisplayController.java:181)
E/AndroidRuntime(23323):    at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:233)
E/AndroidRuntime(23323):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime(23323):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime(23323):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime(23323):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime(23323):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738)
E/AndroidRuntime(23323):    at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(23323):    at android.os.MessageQueue.next(MessageQueue.java:335)
E/AndroidRuntime(23323):    at android.os.Looper.loop(Looper.java:183)
E/AndroidRuntime(23323):    at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(23323):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(23323):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(23323):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process (23323): Sending signal. PID: 23323 SIG: 9
Error handling 'checkPlatformOverride' custom request: ext.flutter.platformOverride: (-32000) Bad state: The client closed with pending request "ext.flutter.platformOverride".
Error handling 'checkBrightnessOverride' custom request: ext.flutter.brightnessOverride: (-32000) Bad state: The client closed with pending request "ext.flutter.brightnessOverride".
Error handling 'serviceExtension' custom request: ext.flutter.inspector.setPubRootDirectories: (-32000) Bad state: The client closed with pending request "ext.flutter.inspector.setPubRootDirectories".
Error handling 'checkIsWidgetCreationTracked' custom request: ext.flutter.inspector.isWidgetCreationTracked: (-32000) Bad state: The client closed with pending request "ext.flutter.inspector.isWidgetCreationTracked".
Lost connection to device.

Wrapped YandexMap()into SafeArea() output is:

W/yandex.maps(23736): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps(23736): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
W/yandex.maps(23736): yandex::maps::runtime::api_key::ApiKey::setValue: API key is already set. Ignored.
W/yandex.maps(23736): yandex::maps::runtime::locale::internal::LocaleManager::setLocale: Locale is already set. Ignored.
W/Gralloc4(23736): allocator 3.x is not supported
E/AndroidRuntime(23736): FATAL EXCEPTION: main
E/AndroidRuntime(23736): Process: ru.soloroman.vrum_app, PID: 23736
E/AndroidRuntime(23736): java.lang.AbstractMethodError: abstract method "void io.flutter.plugin.platform.PlatformView.onFlutterViewAttached(android.view.View)"
E/AndroidRuntime(23736):    at io.flutter.plugin.platform.VirtualDisplayController.onFlutterViewAttached(VirtualDisplayController.java:181)
E/AndroidRuntime(23736):    at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:233)
E/AndroidRuntime(23736):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime(23736):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime(23736):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime(23736):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime(23736):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738)
E/AndroidRuntime(23736):    at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(23736):    at android.os.MessageQueue.next(MessageQueue.java:335)
E/AndroidRuntime(23736):    at android.os.Looper.loop(Looper.java:183)
E/AndroidRuntime(23736):    at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(23736):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(23736):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(23736):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process (23736): Sending signal. PID: 23736 SIG: 9
Error handling 'checkPlatformOverride' custom request: ext.flutter.platformOverride: (-32000) Bad state: The client closed with pending request "ext.flutter.platformOverride".
Error handling 'checkBrightnessOverride' custom request: ext.flutter.brightnessOverride: (-32000) Bad state: The client closed with pending request "ext.flutter.brightnessOverride".
Error handling 'serviceExtension' custom request: ext.flutter.inspector.setPubRootDirectories: (-32000) Bad state: The client closed with pending request "ext.flutter.inspector.setPubRootDirectories".
Error handling 'checkIsWidgetCreationTracked' custom request: ext.flutter.inspector.isWidgetCreationTracked: (-32000) Bad state: The client closed with pending request "ext.flutter.inspector.isWidgetCreationTracked".
Lost connection to device.
DCrow commented 3 years ago

Hello.

This seems to have the same problem as https://github.com/flutter/flutter/issues/72185 Needs to be fixed by flutters team.