使用 jitsi_meet flutter 包的 Flutter 在 IOS 上生成错误
Flutter using jitsi_meet flutter package generate error on IOS
我正在尝试创建一个 flutter 应用程序并集成 jitsi_meet flutter 包我按照文档中指示的说明进行操作。
我的 flutter 版本和 IOS 通过 flutter doctor
Flutter version 2.8.1
develop for iOS and macOS (Xcode 13.1)
我的配置pubspec.yaml
dependencies:
flutter:
sdk: flutter
jitsi_meet: ^4.0.0
我的播客文件
platform :ios, '11.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
在我的 pslistkeys/string 下方添加
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) MyApp needs access to your camera for meetings.</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) MyApp needs access to your microphone for meetings.</string>
在此配置之后,我还将部署构建更改为 ios 11,如其他解决方案所述,但在 运行 使用我的 simulator iPhone 13
构建后,出现以下错误
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/jitsi_meet-umbrella.h"
^
/Users/kaori/Documents/development/projects/fluttermeet/ios/Pods/Target Support Files/jitsi_meet/jitsi_meet-umbrella.h:13:9: note: in file included from /Users/kaori/Documents/development/projects/fluttermeet/ios/Pods/Target Support Files/jitsi_meet/jitsi_meet-umbrella.h:13:
#import "JitsiMeetPlugin.h"
^
无法在 ios 上构建它。
我通过在我的播客文件中添加以下行来构建它
platform :ios, '11.0'
....
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Required by jitsi
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
and 运行 flutter clean
+ flutter pub get
and cd ios
and 运行 pod install
现在你会遇到一个新问题Xcode 11.2.1 error: Command CompileSwiftSources failed with a nonzero exit code
所以我按照这个问题的解决方案 Xcode 11.2.1 error: Command CompileSwiftSources failed with a nonzero exit code
打开 Xcode 上的 ios 文件夹后,将 Build Options
-> Build Libraries
更改为 Distribution in the targets Build Settings to No
。然后在 ios 文件夹中 运行 flutter run
并且构建成功,希望这对遇到相同问题的任何人有所帮助。
我正在尝试创建一个 flutter 应用程序并集成 jitsi_meet flutter 包我按照文档中指示的说明进行操作。
我的 flutter 版本和 IOS 通过 flutter doctor
Flutter version 2.8.1
develop for iOS and macOS (Xcode 13.1)
我的配置pubspec.yaml
dependencies:
flutter:
sdk: flutter
jitsi_meet: ^4.0.0
我的播客文件
platform :ios, '11.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
在我的 pslistkeys/string 下方添加
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) MyApp needs access to your camera for meetings.</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) MyApp needs access to your microphone for meetings.</string>
在此配置之后,我还将部署构建更改为 ios 11,如其他解决方案所述,但在 运行 使用我的 simulator iPhone 13
构建后,出现以下错误
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/jitsi_meet-umbrella.h"
^
/Users/kaori/Documents/development/projects/fluttermeet/ios/Pods/Target Support Files/jitsi_meet/jitsi_meet-umbrella.h:13:9: note: in file included from /Users/kaori/Documents/development/projects/fluttermeet/ios/Pods/Target Support Files/jitsi_meet/jitsi_meet-umbrella.h:13:
#import "JitsiMeetPlugin.h"
^
无法在 ios 上构建它。
我通过在我的播客文件中添加以下行来构建它
platform :ios, '11.0'
....
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Required by jitsi
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
and 运行 flutter clean
+ flutter pub get
and cd ios
and 运行 pod install
现在你会遇到一个新问题Xcode 11.2.1 error: Command CompileSwiftSources failed with a nonzero exit code
所以我按照这个问题的解决方案 Xcode 11.2.1 error: Command CompileSwiftSources failed with a nonzero exit code
打开 Xcode 上的 ios 文件夹后,将 Build Options
-> Build Libraries
更改为 Distribution in the targets Build Settings to No
。然后在 ios 文件夹中 运行 flutter run
并且构建成功,希望这对遇到相同问题的任何人有所帮助。