简体   繁体   English

使用带有静态库的插件构建 Flutter iOS 项目时出错

[英]Error building flutter iOS project using a plugin with static library

Currently I'm trying to use this plugin flutter-zsdk as a dependency of my project and I'm not able to build/run the project for iOS.目前我正在尝试使用这个插件flutter-zsdk作为我项目的依赖项,但我无法为 iOS 构建/运行该项目。 For Android the project builds/run just fine, but for iOS I get the following error:对于 Android,项目构建/运行得很好,但对于 iOS,我收到以下错误:

Running Xcode build
Xcode build done.                                            3.0s
Failed to build iOS app
Error output from Xcode build:
↳
    2020-02-07 12:20:44.583 xcodebuild[29722:10555466]  DTDeviceKit: deviceType from 00008006-001C498E2206002E was NULL
    2020-02-07 12:20:44.584 xcodebuild[29722:10555578]  DTDeviceKit: deviceType from 00008006-001C498E2206002E was NULL
    2020-02-07 12:20:44.677 xcodebuild[29722:10555344] [MT] DTDeviceKit: deviceType from 00008006-001C498E2206002E was NULL
    2020-02-07 12:20:44.681 xcodebuild[29722:10555344] [MT] DTDeviceKit: deviceType from 00008006-001C498E2206002E was NULL
    2020-02-07 12:20:44.685 xcodebuild[29722:10555344] [MT] DTDeviceKit: deviceType from 00008006-001C498E2206002E was NULL
    ** BUILD FAILED **



Xcode's output:
↳
    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_SGD", referenced from:
          objc-class-ref in FlutterZsdkPlugin.o
      "_OBJC_CLASS_$_MfiBtPrinterConnection", referenced from:
          objc-class-ref in FlutterZsdkPlugin.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

Error launching application on iDevice.

Note 1: This plugin uses a static library zsdk.a for communication with printers.注 1:此插件使用静态库zsdk.a与打印机进行通信。

Note 2: I opened the flutter-zsdk plugin as a project in Android Studio and I were able to build/run the example_app for both Android and iOS without any extra action… just opened the project, and build and everything worked fine.注 2:我在 Android Studio 中将 flutter-zsdk 插件作为一个项目打开,我能够在没有任何额外操作的情况下为 Android 和 iOS 构建/运行 example_app……只需打开项目,然后构建,一切正常。

So my question: Is there something different in building a project which uses a plugin which in turn uses a static library.a?所以我的问题在构建一个使用插件而使用静态 library.a 的项目时有什么不同吗? Do I have to set something in my iOS project configurations in order to be able to build/run properly this kind of plugin dependency?我是否必须在我的 iOS 项目配置中设置一些东西才能正确构建/运行这种插件依赖项?

Finally I found a solution.最后我找到了解决方案。 I commented the use_frameworks!我评论了use_frameworks! from Podfile and everything worked fine...来自 Podfile,一切正常......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM