Unact / yandex_mapkit

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

yandex_mapkit 1.1.1 не поддерживает симуляторы на Apple Silicon M1 ARM64 #143

Closed nausharipov closed 2 years ago

nausharipov commented 3 years ago

Также пробовал добавить package из github для использования кода из master, но там выходят те же ошибки.

dependencies: yandex_mapkit: ^1.1.1

flutter run:

Running "flutter pub get" in client...                           1,329ms
Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
⣾Running pod install...                                              7.3s
Running Xcode build...                                                  
 └─Compiling, linking and signing...                         6.0s
Xcode build done.                                           46.5s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[19108]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f7c8c188) and ?? (0x1188a82b8). One of the two will be used. Which one is undefined.
    objc[19108]: Class AMSupportURLSession is implemented in both ?? (0x1f7c8c1d8) and ?? (0x1188a8308). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **

Xcode's output:
↳
    /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.m:395:23: warning:
    'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = true;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
    In module 'WebKit' imported from /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/WebKit.framework/Head
    ers/WKWebViewConfiguration.h:213:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
    /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.m:407:23: warning:
    'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = false;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
    In module 'WebKit' imported from /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/WebKit.framework/Head
    ers/WKWebViewConfiguration.h:213:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
    2 warnings generated.
    /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.m:395:23: warning:
    'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = true;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
    In module 'WebKit' imported from /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/WebKit.framework/Head
    ers/WKWebViewConfiguration.h:213:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
    /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.m:407:23: warning:
    'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            configuration.requiresUserActionForMediaPlayback = false;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mediaTypesRequiringUserActionForPlayback
    In module 'WebKit' imported from /Users/Darkhan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.12/ios/Classes/FlutterWebView.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/WebKit.framework/Head
    ers/WKWebViewConfiguration.h:213:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked deprecated here
    @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(9.0, 10.0));
                               ^
    2 warnings generated.
    In file included from /Users/Darkhan/Developer/uvu/mobile/client/ios/ImageNotification/NotificationService.m:9:
    /Users/Darkhan/Developer/uvu/mobile/client/build/ios/Debug-iphonesimulator/FirebaseMessaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h:17:9: warning:
    double-quoted include "FIRMessaging.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
    #import "FIRMessaging.h"
            ^~~~~~~~~~~~~~~~
            <FirebaseMessaging/FIRMessaging.h>
    /Users/Darkhan/Developer/uvu/mobile/client/build/ios/Debug-iphonesimulator/FirebaseMessaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h:18:9: warning:
    double-quoted include "FIRMessagingExtensionHelper.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
    #import "FIRMessagingExtensionHelper.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            <FirebaseMessaging/FIRMessagingExtensionHelper.h>
    2 warnings generated.
    In file included from /Users/Darkhan/Developer/uvu/mobile/client/ios/ImageNotification/NotificationService.m:9:
    /Users/Darkhan/Developer/uvu/mobile/client/build/ios/Debug-iphonesimulator/FirebaseMessaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h:17:9: warning:
    double-quoted include "FIRMessaging.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
    #import "FIRMessaging.h"
            ^~~~~~~~~~~~~~~~
            <FirebaseMessaging/FIRMessaging.h>
    /Users/Darkhan/Developer/uvu/mobile/client/build/ios/Debug-iphonesimulator/FirebaseMessaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h:18:9: warning:
    double-quoted include "FIRMessagingExtensionHelper.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
    #import "FIRMessagingExtensionHelper.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            <FirebaseMessaging/FIRMessagingExtensionHelper.h>
    2 warnings generated.
    ld: in /Users/Darkhan/Developer/uvu/mobile/client/ios/Pods/YandexMapsMobile/YandexMapsMobile.framework/YandexMapsMobile(YMKRouteView_Binding.mm.o), building for iOS
    Simulator, but linking in object file built for iOS, file
    '/Users/Darkhan/Developer/uvu/mobile/client/ios/Pods/YandexMapsMobile/YandexMapsMobile.framework/YandexMapsMobile' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone SE (2nd generation).

flutter doctor -v:

flutter doctor -v
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.2.3 20D91 darwin-arm, locale en-KZ)
    • Flutter version 2.5.0 at /Users/Darkhan/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cc385b4b8 (13 days ago), 2021-09-07 23:01:49 -0700
    • Engine revision f0826da7ef
    • Dart version 2.14.0

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/Darkhan/Library/Android/sdk
    ✗ 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 at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.2

[✓] 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-6915495)

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

[✓] Connected device (2 available)
    • iPhone SE (2nd generation) (mobile) • 81ED2D87-8FDB-4A38-BBFC-3AE9A76C0BAD • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 93.0.4577.82
DCrow commented 3 years ago

Добрый день!

Нативная либа под iOS не поддерживает m1 маки https://github.com/yandex/mapkit-ios-demo/issues/106 На симуляторе тестить получится, если только собирать через rosetta, либо тестить настоящим устройством.

Rogue85 commented 3 years ago

Я собираю на M1 без Rosetta.

Добавьте в Podfile:

installer.pods_project.targets.each do |target|
 target.build_configurations.each do |config|
  config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
 end
end

Иногда может появляться другая ошибка, но если после этого закомментировать данную строку и собрать снова - все ок. #config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"

Если найдете и поделитесь решением данной проблемы - буду признателен.

DCrow commented 2 years ago

Нативная библиотека обновлена в 3.0.0, и теперь поддерживает arm маки.