摘要:我正在构建一个 Flutter 插件,用于我正在开发的多个项目。我没有编写自定义平台特定代码的经验。
我在将 IOS *.Framework 和 *-Resources.bundle 的 SDK 库导入我的插件时遇到问题。
我已经尝试过https://github.com/flutter/flutter/issues/17978中的解决方案
另外,我尝试清理和重新构建应用程序但没有成功,并尝试清理和重新构建示例应用程序但没有成功,我收到以下错误:
*.podspec:
Pod::Spec.new do |s|
s.name = 'plugin_name'
s.version = '0.0.1'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.ios.deployment_target = '9.0'
end
Pod::Spec.new do |spec|
spec.name = "plugin_name"
spec.version = "2.3.7"
spec.summary = "SDK"
spec.homepage = "https://hkhars.com"
spec.author = "Hussain Alkhars"
spec.license = { :file => '../LICENSE' }
spec.source = { :path => '.' }
spec.ios.deployment_target = '9.0'
spec.preserve_paths = 'IOSFLUTTERSDK.framework'
spec.xcconfig = { 'OTHER_LDFLAGS' => '-framework IOSFLUTTERSDK' }
spec.vendored_frameworks = 'IOSFLUTTERSDK.framework'
spec.public_header_files = "IOSFLUTTERSDK.framework/Headers/*.h"
spec.resource_bundle = { 'IOSFLUTTERSDK-Resources' => './*' }
end
尝试构建时出错flutter build ios --no-codesign
fatal error: 'plugin_name/PluginNamePlugin.h' file not found
#import <plugin_name/PluginNamePlugin.h>```