arcticfox1919 / flutter-scankit

Flutter QR code scanning
MIT License
141 stars 46 forks source link

iOS can't build framework #85

Open estherzhangyue opened 1 month ago

estherzhangyue commented 1 month ago

version: flutter_scankit: ^2.0.3

problem: our flutter app is as a module in an iOS native project, so we need build framework first, but it popup error when Building plugins.Here is error log:

Unable to build plugin frameworks: 2024-03-05 17:35:08.563 xcodebuild[38534:1367130] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Enabled
set via user default (DVTEnableCoreDevice=enabled)
2024-03-05 17:35:08.591 xcodebuild[38534:1367193]  DTDeviceKit: DTDKRemoteDeviceDataListener thread started. Set iOSDeviceDiscoveryLogLevel to
verbose (3) to log notification events
2024-03-05 17:35:08.774 xcodebuild[38534:1367130] [MT] DVTDevice: Adjusting available devices (inserting): added = {(
    <DVTFoundation.DVTCoreDevice: 0x10dd043f0 (hey jojo (CoreDevice) | arm64e)>
)} removed = (null)
2024-03-05 17:35:08.775 xcodebuild[38534:1367130] [MT] DVTDevice: DVTDeviceStateManager: Began managing new device with identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.775 xcodebuild[38534:1367130] [MT] DVTDevice: DVTDeviceStateManager: Notified of new state (0) for device identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.776 xcodebuild[38534:1367197]  DVTDevice: DVTDeviceStateManager: Notified of new state (1) for device identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.776 xcodebuild[38534:1367197]  DVTDevice: DVTDeviceStateManager: Notified of new state (3) for device identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.776 xcodebuild[38534:1367197]  DVTDevice: DVTDeviceStateManager: Notified of new state (7) for device identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.776 xcodebuild[38534:1367197]  DVTDevice: DVTDeviceStateManager: Notified of new state (8) for device identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.776 xcodebuild[38534:1367197]  DVTDevice: DVTDeviceStateManager: Notified of new state (10) for device identifier
00008130-001658CC3CF0001C
2024-03-05 17:35:08.778 xcodebuild[38534:1367130] [MT] DVTDevice: Adjusting available devices (replacing): added = {(
    <DVTiPhoneSimulator: 0x136e359d0> {
        SimDevice: iPhone 14 (E3D1D1E9-E327-419A-8C8D-46E90C86FBDF, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf26d60> {
        SimDevice: iPhone SE (3rd generation) (A0B85C17-13C9-4542-905A-861605F7630F, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e399c0> {
        SimDevice: iPhone SE (3rd generation) (35A94E2A-D0FC-4C39-830A-F606668AE59C, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e38ca0> {
        SimDevice: iPad Pro (11-inch) (4th generation) (9E360EB6-E597-4BBD-8D5C-CC646B2B339D, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2dac0> {
        SimDevice: iPhone 14 (008D82F7-47A3-4070-A8BC-397474C99581, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2df20> {
        SimDevice: iPhone 14 Pro (D47B1D7C-D212-4071-881B-023E0B2EC3A8, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf25dc0> {
        SimDevice: iPhone 14 Plus (D9F7FDF7-4992-4FF6-96B9-782C4CD95F36, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2e5c0> {
        SimDevice: iPhone 14 Pro Max (DC61A149-D7A0-47DD-AA0B-6F89B96F4D70, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2ea20> {
        SimDevice: iPad (10th generation) (7D367EB8-B073-497D-ABB2-709BF2A09171, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2ec50> {
        SimDevice: iPad mini (6th generation) (445B523B-F2F7-41B6-BFDC-D1960D3D3D3E, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e357a0> {
        SimDevice: iPhone SE (3rd generation) (E75F726A-AB44-4E4C-9788-21EE4F374E06, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e35e30> {
        SimDevice: iPhone 14 Pro (DAF17E5E-A909-46E9-AFF0-EC5A0A6C43FC, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e31b20> {
        SimDevice: iPad (9th generation) (C7FC4F0D-0936-44CC-A6F7-A88467521E04, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e39100> {
        SimDevice: iphone x (88682730-5B7C-4932-816C-03C98022E2FF, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2ee80> {
        SimDevice: iPad Pro (11-inch) (4th generation) (1A9F1D60-44A9-40E7-A104-4D79A79F1C16, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e35110> {
        SimDevice: iPad mini (6th generation) (882537F3-D840-4D63-8D32-89841519CA6C, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e34ee0> {
        SimDevice: iPad Air (5th generation) (548ECBF8-D19B-428E-8570-3882FA678C40, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e2e9b0> {
        SimDevice: iPhone 14 Pro (386B09D5-3D23-4022-A617-040233A9241E, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e38ed0> {
        SimDevice: iPad Pro (12.9-inch) (6th generation) (D010F089-3836-4EB9-9894-BFEE51590EA8, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e34a80> {
        SimDevice: iPad Pro (11-inch) (3rd generation) (8C2FEAC8-1EBF-486A-BF17-B5B12853971F, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e35570> {
        SimDevice: iPhone Xʀ (5BA3A288-D12A-47FF-B8F8-ECC8B95F681B, iOS 16.4, Booted)
},
    <DVTiPhoneSimulator: 0x10cf2e7f0> {
        SimDevice: iPad Air (5th generation) (A5FD05D4-CCF1-4082-B655-7FC2B4789AC0, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2dcf0> {
        SimDevice: iPhone 14 Plus (539DB90D-DD47-4F2A-BBCD-D0D63032BD89, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2e150> {
        SimDevice: iPhone 14 Pro (70C2A31B-70E4-4F51-BBCD-A16B873D9DD1, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf25b90> {
        SimDevice: iPhone 14 (56618120-E33E-4827-B0C6-2B8E78CEDDD5, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e39790> {
        SimDevice: iPhone Xʀ (3B78D9EA-2B07-43C4-ACE5-FB9CDECED70D, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2f0b0> {
        SimDevice: iPad Pro (12.9-inch) (6th generation) (C13554BD-5C6F-4B0A-B104-057422F40C66, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e35c00> {
        SimDevice: iPhone 14 Plus (C500EB0E-50B9-48E3-96AA-36F60067AAE0, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e38a70> {
        SimDevice: iPad mini (6th generation) (1E0653FC-47A1-44B0-8F4A-8A58B24F1355, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e38840> {
        SimDevice: iPad (10th generation) (74AD11A0-3987-4E51-8AEE-A6CC402153C4, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e383e0> {
        SimDevice: iPhone 14 Pro Max (3901C858-EBC1-40ED-A9BB-53CC83C61E0A, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e38610> {
        SimDevice: iPad Air (5th generation) (71D97F3C-3A77-4D7B-948C-D154109AA84E, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e34cb0> {
        SimDevice: iPad Pro (12.9-inch) (5th generation) (D36A690F-739C-4500-A596-3FC4BFFE35CE, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf26b30> {
        SimDevice: iPhone X (5355D4B4-700F-4B16-B76F-247E3E3AFF56, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf31190> {
        SimDevice: iPhone 8 Plus (4B5CBFD9-EA1C-4566-9E57-39C6B61B4492, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e35340> {
        SimDevice: iPhone 8 (1032E39D-1B37-45DC-B0EA-3F9E1EE7A9E7, iOS 16.4, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e39560> {
        SimDevice: iphone xr (D028CB5C-A559-45AF-929C-3A9B01B79E42, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e2ebe0> {
        SimDevice: iPhone 14 Pro Max (FEE51AAA-BBA6-4DF2-826D-411E9AFE2EAF, iOS 16.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x136e39330> {
        SimDevice: iphone xr (77C8E00C-B3CE-4608-9C2F-34E64CADBC3B, iOS 17.0, Shutdown)
},
    <DVTiPhoneSimulator: 0x10cf2d890> {
        SimDevice: iPhone 14 Pro (700B549B-7436-4B31-9F51-88DEFA463061, iOS 16.0, Shutdown)
}
)} removed = {(
)}
2024-03-05 17:35:08.874 xcodebuild[38534:1367158]  DTDeviceKit: Started connection with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:08.899 xcodebuild[38534:1367130] [MT] DVTDevice: Adjusting available devices (replacing): added = {(
)} removed = {(
)}
2024-03-05 17:35:08.905 xcodebuild[38534:1367130] [MT] DVTDevice: Adjusting available devices (replacing): added = {(
)} removed = {(
)}
2024-03-05 17:35:08.921 xcodebuild[38534:1367158]  DTDeviceKit: Started session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:08.932 xcodebuild[38534:1367158]  DTDeviceKit: Ending session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:08.934 xcodebuild[38534:1367158]  DTDeviceKit: Ending connection with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.033 xcodebuild[38534:1367191]  DTDeviceKit: Started session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.056 xcodebuild[38534:1367191]  DTDeviceKit: Ending session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.056 xcodebuild[38534:1367157]  DTDeviceKit: DTDKExecuteInSession() entering session limit gate
2024-03-05 17:35:09.059 xcodebuild[38534:1367157]  DTDeviceKit: Started connection with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.064 xcodebuild[38534:1367130] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x126e5cb00), hey jojo, iPhone, 16.7.5 (20H307),
32e9cebde8ef411f284b414ee278b8e98e7d7a9a> ################ HAS CONNECTED ###################
2024-03-05 17:35:09.064 xcodebuild[38534:1367130] [MT] iPhoneConnect: Set DTDeviceKitLogLevel to verbose (3) for detailed connection logs
2024-03-05 17:35:09.064 xcodebuild[38534:1367130] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x126e5cb00), hey jojo, iPhone, 16.7.5 (20H307),
32e9cebde8ef411f284b414ee278b8e98e7d7a9a> conforms to device type Xcode.DeviceType.iPhone
2024-03-05 17:35:09.065 xcodebuild[38534:1367222]  DTDeviceKit: Not mounting DDI because device already has standard tools.
2024-03-05 17:35:09.065 xcodebuild[38534:1367222]  DVTDevice: 0.000 elapsed -- mountDDI completed.
2024-03-05 17:35:09.065 xcodebuild[38534:1367222]  DVTDevice: 0.000 sec, +0.000 sec -- start
2024-03-05 17:35:09.065 xcodebuild[38534:1367222]  DVTDevice: 0.000 sec, +0.000 sec -- end
2024-03-05 17:35:09.066 xcodebuild[38534:1367158]  DTDeviceKit: DTDKObtainSymbolCopyingFLock:
file:///Users/estzhang/Library/Developer/Xcode/iOS%20DeviceSupport/16.7.5%20(20H307)/.copying_lock
2024-03-05 17:35:09.101 xcodebuild[38534:1367157]  DTDeviceKit: Started session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.200 xcodebuild[38534:1367157]  DTDeviceKit: Ending session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.201 xcodebuild[38534:1367191]  DTDeviceKit: Device hey jojo (32e9cebde8ef411f284b414ee278b8e98e7d7a9a) now allows starting
secure services
2024-03-05 17:35:09.203 xcodebuild[38534:1367157]  DTDeviceKit: Ending connection with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.203 xcodebuild[38534:1367157]  DTDeviceKit: DTDKExecuteInSession() exiting session limit gate
2024-03-05 17:35:09.313 xcodebuild[38534:1367190]  DTDeviceKit: Started session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:09.317 xcodebuild[38534:1367190]  DTDeviceKit: Ending session with 32e9cebde8ef411f284b414ee278b8e98e7d7a9a
2024-03-05 17:35:10.067 xcodebuild[38534:1367158]  DTDeviceKit: DTDKObtainSymbolProcessingFLock:
file:///Users/estzhang/Library/Developer/Xcode/iOS%20DeviceSupport/16.7.5%20(20H307)/.processing_lock
2024-03-05 17:35:10.067 xcodebuild[38534:1367158]  DVTDevice: 1.002 elapsed -- downloadSymbols completed.
2024-03-05 17:35:10.067 xcodebuild[38534:1367158]  DVTDevice: 0.000 sec, +0.000 sec -- start
2024-03-05 17:35:10.067 xcodebuild[38534:1367158]  DVTDevice: 1.002 sec, +1.002 sec -- end
2024-03-05 17:35:10.067 xcodebuild[38534:1367158]  DTDeviceKit: DTDKReleaseSymbolCopyingFLock:
file:///Users/estzhang/Library/Developer/Xcode/iOS%20DeviceSupport/16.7.5%20(20H307)/.copying_lock
2024-03-05 17:35:10.068 xcodebuild[38534:1367130] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x126e5cb00), hey jojo, iPhone, 16.7.5 (20H307),
32e9cebde8ef411f284b414ee278b8e98e7d7a9a> ################ FINISHED HAS CONNECTED (1) ###################
2024-03-05 17:35:10.068 xcodebuild[38534:1367130] [MT] DVTDevice: 1.003 elapsed -- makeReady completed.
2024-03-05 17:35:10.068 xcodebuild[38534:1367130] [MT] DVTDevice: 0.000 sec, +0.000 sec -- start
2024-03-05 17:35:10.068 xcodebuild[38534:1367130] [MT] DVTDevice: 1.003 sec, +1.003 sec -- end
2024-03-05 17:35:10.068 xcodebuild[38534:1367158]  DTDeviceKit: DTDKReleaseSymbolProcessingFLock:
file:///Users/estzhang/Library/Developer/Xcode/iOS%20DeviceSupport/16.7.5%20(20H307)/.processing_lock
** BUILD FAILED **

The following build commands failed:
    CompileC
    /Users/estzhang/Project/cybex-flutter-module/build/ios/framework/Release/iphoneos/Pods.build/Release-iphoneos/cybex_scan_plugin.build/Objects-norm
    al/arm64/ScanPlugin.o /Users/estzhang/.pub-cache/hosted/pub.dev/cybex_scan_plugin-0.0.3/ios/Classes/ScanPlugin.m normal arm64 objective-c
    com.apple.compilers.llvm.clang.1_0.compiler (in target 'cybex_scan_plugin' from project 'Pods')
(1 failure)

do we have some solution to fix this error?

wangchaohao123 commented 1 month ago

我把fluter项目的里的poffile文件里这样改了下,可以打成framework了 platform :ios, '12.0' //最低12

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64' end
xcconfig_path = config.base_configuration_reference.real_path xcconfig = File.read(xcconfig_path) xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } end end end: 还需要去华为开发平台下载ScanKitFrameWork.framework and ScanKitFrameWorkBundle.bundle放在原生项目里https://developer.huawei.com/consumer/en/doc/HMSCore-Guides/ios-integrating-sdk-0000001050172400