Unact / yandex_mapkit

Flutter implementation of YandexMapkit
MIT License
133 stars 149 forks source link

Крашится IOS приложения при не установленном API_KEY #339

Closed Lonti6 closed 11 months ago

Lonti6 commented 11 months ago

Если в AppDelegate.swift не прописывать YMKMapKit.setApiKey("API_KEY"), приложение крашится при запуске.

В логах девайса:

стандартное 11:34:31.643546+0500    Runner  *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You need to set API key before using MapKit.'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000113607378 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x0000000116d1bbaf objc_exception_throw + 48
    2   Foundation                          0x000000011826f6ac _userInfoForFileAndLine + 0
    3   Runner                              0x00000001046cb723 +[YMKMapKit(Factory) mapKit] + 291
    4   Runner                              0x00000001050c400a $s13yandex_mapkit23SwiftYandexMapkitPluginC8register4withySo07FlutterF9Registrar_p_tFZTf4nd_n + 202
    5   Runner                              0x00000001050c3e79 $s13yandex_mapkit23SwiftYandexMapkitPluginC8register4withySo07FlutterF9Registrar_p_tFZTo + 25
    6   Runner                              0x00000001025dcafd +[GeneratedPluginRegistrant registerWithRegistry:] + 2813
    7   Runner                              0x00000001025e23e5<…>

Если прописать YMKMapKit.setApiKey("API_KEY"), то все стартует нормально.

Можно ли как то стартануть приложение, не прописывая API KEY?

[✓] Flutter (Channel stable, 3.10.4, on macOS 13.1 22C65 darwin-arm64 (Rosetta),
    locale ru-RU)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.82.0)
[✓] Connected device (3 available)
[✓] Network resources
DCrow commented 11 months ago

Здравствуйте!

Нет, не прописывая ключ приложение запустить с этой либой нельзя.