Closed anchao-lu closed 3 years ago
完整的 log Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Running Xcode build... Xcode build done. 11.7s Failed to build iOS app Error output from Xcode build: ↳ BUILD FAILED
Xcode's output:
↳
While building module 'r_scan' imported from /Users/monkey/Desktop/flutter_app/ios/Runner/GeneratedPluginRegistrant.m:128:
In file included from
^
/Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/RScanResult.h:11:9: error: include of non-modular header inside framework module 'r_scan.RScanResult': '/Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/ZBarSDK/ZBarSDK.framework/Headers/ZBarSDK.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import "ZBarSDK.h"
^
While building module 'r_scan' imported from /Users/monkey/Desktop/flutter_app/ios/Runner/GeneratedPluginRegistrant.m:128:
In file included from <module-includes>:1:
In file included from /Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/r_scan-umbrella.h:16:
In file included from /Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/RScanResult.h:11:
In file included from /Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/ZBarSDK/ZBarSDK.framework/Headers/ZBarSDK.h:34:
/Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/ZBarSDK/ZBarSDK.framework/Headers/ZBarCameraSimulator.h:37:5: warning: 'UIPopoverController' is deprecated: first deprecated in iOS 9.0 - UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal presentation style of UIModalPresentationPopover and UIPopoverPresentationController. [-Wdeprecated-declarations]
UIPopoverController *pickerPopover;
^
In module 'UIKit' imported from /Users/monkey/Desktop/flutter_app/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/r_scan-umbrella.h:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h:26:12: note: 'UIPopoverController' has been explicitly marked deprecated here
@interface UIPopoverController : NSObject <UIAppearanceContainer> {}
^
1 warning and 2 errors generated.
/Users/monkey/Desktop/flutter_app/ios/Runner/GeneratedPluginRegistrant.m:128:9: fatal error: could not build module 'r_scan'
#import <r_scan/RScanPlugin.h>
~~~~~~~^
1 warning and 3 errors generated.
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 Pro Max.
I'm getting this exact same error, but using Flutter 1.22.5. It worked fine a week or two ago when I last built for iOS.
这个是一样的报错信息 Error output from Xcode build: ↳ BUILD FAILED
Xcode's output:
↳
While building module 'r_scan' imported from /Users/tpc/Desktop/t/ttt/ios/Runner/GeneratedPluginRegistrant.m:56:
In file included from
^
/Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/RScanResult.h:11:9: error: include of non-modular header inside framework
module 'r_scan.RScanResult': '/Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/ZBarSDK/ZBarSDK.framework/Headers/ZBarSDK.h'
[-Werror,-Wnon-modular-include-in-framework-module]
#import "ZBarSDK.h"
^
While building module 'r_scan' imported from /Users/tpc/Desktop/t/ttt/ios/Runner/GeneratedPluginRegistrant.m:56:
In file included from <module-includes>:1:
In file included from /Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/r_scan-umbrella.h:16:
In file included from /Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/RScanResult.h:11:
In file included from /Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/ZBarSDK/ZBarSDK.framework/Headers/ZBarSDK.h:34:
/Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/ZBarSDK/ZBarSDK.framework/Headers/ZBarCameraSimulator.h:37:5: warning: 'UIPopoverController' is
deprecated: first deprecated in iOS 9.0 - UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal
presentation style of UIModalPresentationPopover and UIPopoverPresentationController. [-Wdeprecated-declarations]
UIPopoverController *pickerPopover;
^
In module 'UIKit' imported from /Users/tpc/Desktop/t/ttt/build/ios/Debug-iphonesimulator/r_scan/r_scan.framework/Headers/r_scan-umbrella.h:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.3.sdk/System/Library/Frameworks/UIKit.framework/Head
ers/UIPopoverController.h:26:12: note: 'UIPopoverController' has been explicitly marked deprecated here
@interface UIPopoverController : NSObject <UIAppearanceContainer> {}
^
1 warning and 2 errors generated.
/Users/tpc/Desktop/t/ttt/ios/Runner/GeneratedPluginRegistrant.m:56:9: fatal error: could not build module 'r_scan'
#import <r_scan/RScanPlugin.h>
~~~~~~~^
1 warning and 3 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a
development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator. Error launching application on iPhone 12 Pro Max.
这个是版本信息,不不是flutter2,也报这个 Flutter 1.26.0-2.0.pre.401 • channel unknown • unknown source Framework • revision da5a454d5c (8 weeks ago) • 2021-01-17 01:24:03 -0500 Engine • revision 609036f2bf Tools • Dart 2.12.0 (build 2.12.0-236.0.dev)
已解决fatal error: could not build module 'r_scan'
找到r_scan的pubspec.yaml文件 1、注释掉flutter: ">=1.12.0 <2.0.0" 2、platforms修改为 androidPackage: com.rhyme.r_scan pluginClass: RScanPlugin 3、clean工程,再次编译即可 4、再不会就随便找一个可以用的其它plugin,对比修改一下即可
再补充几条: 1、r_scan/ios/r_scan.podspec文件ZXingObjC引用修改为:s.dependency 'ZXingObjC' 2、源码中所有的头文件引用修改为:
3、去用吧,good luck
android我直接引用没有什么问题,ios需要按照上述修改后,用本地插件的方式引用到工程中,明显作者对于ios引用此插件的兼容性没有做过多的测试,大部分使用者,ios估计是直接报错,大家要给作者加油打气,维护好此插件
已经换了其他插件,作者 null safety 好像都不打算维护了
已经换了其他插件,作者 null safety 好像都不打算维护了
你用的哪个插件,我测试的目前较多star的插件,要么只支持android,要么扫描效果不是很好。这个插件虽然作者可能不维护了,我底层修改一些代码后,还是比较稳定的
v0.1.6
flutter_app/ios/Runner/GeneratedPluginRegistrant.m:128:9: fatal error: could not build module 'r_scan'