首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法构建灵活的应用程序--没有这样的模块“heresdk”

无法构建灵活的应用程序--没有这样的模块“heresdk”
EN

Stack Overflow用户
提问于 2021-10-04 22:12:17
回答 2查看 3.4K关注 0票数 2

我遵循guide/topics/quick-start.html#try-the-example-apps的指示,既可以尝试示例应用程序,也可以创建新项目。两者似乎都不起作用。运行失败,出现以下错误:

代码语言:javascript
复制
Klamath:hello_map_app mathias$ flutter run
Launching lib/main.dart on iPhone 12 in debug mode...
Running pod install...                                           1,603ms
Running Xcode build...
Xcode build done.                                            6.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    warning: [CP] Unable to find matching .xcframework slice in
    '/Users/mathias/Downloads/heresdk-explore-flutter-4.9.0.0.2063/heresdk-explore-flutter-examples-4.9.0.0/hello_map_app/ios/Pods/../.symlinks/plugins/here_sdk/ios/
    Frameworks/heresdk.xcframework heresdk framework ios-x86_64-simulator ios-arm64' for the current build architectures (arm64 x86_64).
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    /Users/mathias/Downloads/heresdk-explore-flutter-4.9.0.0.2063/heresdk-explore-flutter-examples-4.9.0.0/hello_map_app/plugins/here_sdk/ios/Classes/MapController.s
    wift:14:8: error: no such module 'heresdk'
    import heresdk
           ^
    /Users/mathias/Downloads/heresdk-explore-flutter-4.9.0.0.2063/heresdk-explore-flutter-examples-4.9.0.0/hello_map_app/plugins/here_sdk/ios/Classes/MapController.s
    wift:14:8: error: no such module 'heresdk'
    import heresdk
           ^
    /Users/mathias/Downloads/heresdk-explore-flutter-4.9.0.0.2063/heresdk-explore-flutter-examples-4.9.0.0/hello_map_app/plugins/here_sdk/ios/Classes/MapController.s
    wift:14:8: error: no such module 'heresdk'
    import heresdk
           ^
    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 12.

我注意到没有为iOS插件生成任何Podfile,这与文档的说法相反:

在执行了颤振发布get (或在Android或任何其他IDE中单击相应的Packages按钮)之后,将为iOS创建一个新的Podfile

颤栗医生:

代码语言:javascript
复制
[✓] Flutter (Channel stable, 2.5.2, on Mac OS X 10.15.7 19H1419 darwin-x64, locale en-GB)
    • Flutter version 2.5.2 at /Users/mathias/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3595343e20 (4 days ago), 2021-09-30 12:58:18 -0700
    • Engine revision 6ac856380f
    • Dart version 2.14.3

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mathias/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.2, Build version 12B45b
    • CocoaPods version 1.10.2

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

[✓] Android Studio (version 3.5)
    • 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_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
    • IntelliJ at /Users/mathias/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 61.0.4
    • Dart plugin version 212.5486

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
    • IntelliJ at /Users/mathias/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/212.5284.40/IntelliJ IDEA.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

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1)
    • IntelliJ at /Users/mathias/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7142.45/IntelliJ IDEA.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.59.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (2 available)
    • iPhone 12 (mobile) • D8D4529E-FC01-48BA-A640-451B829D6BF9 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 94.0.4606.71

! Doctor found issues in 1 category.
Process finished with exit code 0

知道有什么问题吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-10-08 13:19:57

这是因为您的Xcode版本太老,不受支持。根据最低要求,至少需要Xcode 12.4。你的版本是12.2。

最重要的是,这里的SDK还没有正式支持Flate2.5。在设备上运行不受影响,这只发生在模拟器上。作为解决办法,在生成的Podfile中修改post_install任务:

代码语言:javascript
复制
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
          config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64' if `uname -m` == "x86_64\n"
        end

  end
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
        end
    end
    project.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
    end
end

我从最新4.9.0.0释放的发布说明中摘录了这一信息。

更新:适用于>= 4.9.2.0版本,不再需要上面的内容,因为这里的SDK现在正式支持用于模拟器和Flash2.5的arm64。

票数 4
EN

Stack Overflow用户

发布于 2021-10-05 05:37:03

将其添加到您的podfile底部并安装吊舱。

代码语言:javascript
复制
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69442904

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档