kaivean / system_proxy

A Flutter Plugin to get system plugin. Use to set dart HttpClient proxy for grabing requests
BSD 3-Clause "New" or "Revised" License
30 stars 24 forks source link

system_proxy-Swift.h file not found #5

Open gyb1314 opened 2 years ago

gyb1314 commented 2 years ago

.pub-cache/hosted/pub.flutter-io.cn/system_proxy-0.1.0/ios/Classes/SystemProxyPlugin.m:2:9: fatal error: 'system_proxy/system_proxy-Swift.h' file not found

import <system_proxy/system_proxy-Swift.h>

        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete

Could not build the precompiled application for the device.

twometresteve commented 2 years ago

Same here, tried both Xcode 12.4 and 13.

cyx114 commented 2 years ago

Same here, I modified the SystemProxyPlugin.m and fixed the issue. image

#if __has_include(<system_proxy/system_proxy-Swift.h>)
#import <system_proxy/system_proxy-Swift.h>
#else
// Support project import fallback if the generated compatibility header
// is not copied when this plugin is created as a library.
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
#import "system_proxy-Swift.h"
#endif