#首次使用mac,flutter友盟推送测试。遇到的问题点总结。
#开发者账号
#证书问题,参考友盟文档https://developer.umeng.com/docs/67966/detail/66748
flutter create -i objc -a java umeng_push
cd /umeng_push/ios
pod init
#增加 并设置下FLUTTER_FRAMEWORK_DIR环境变量flutter/bin/cache/artifacts/engine/ios
#用于加载flutter第三方插件
if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end
target 'Runner' do
use_frameworks!
# Pods for Runner
# Flutter Pods
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']
if File.exists? '../.flutter-plugins'
flutter_root = File.expand_path('..')
File.foreach('../.flutter-plugins') { |line|
plugin = line.split(pattern='=')
if plugin.length == 2
name = plugin[0].strip()
path = plugin[1].strip()
resolved_path = File.expand_path("#{path}/ios", flutter_root)
pod name, :path => resolved_path
else
puts "Invalid plugin specification: #{line}"
end
}
end
end
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
pod install
问题点:[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig` in your build configuration (`Flutter/Debug.xcconfig`).
解决:
文件夹flutter中的为flutter环境配置,配置上是为了避免/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory的问题点,要不还得在build settings中单独的增加个user-defined FLUTTER_ROOT。 Pods下的配置文件就是识别pods下载的第三方库了。
其他问题点:Couldn’t communicate with a helper application.
解决:signing & capabilities 中的 automatically manager signing 不勾选,同时需要导入下provisioning file
#至此直接真机测试了
#友盟测试消息也可顺利收到 。