我正在将flutter模块集成到iOS应用中,并且在安装Pod时遇到此错误。
下面是podfile中的代码。
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'FlutteriOSApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for FlutteriOSApp
target 'FlutteriOSAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'FlutteriOSAppUITests' do
inherit! :search_paths
# Pods for testing
end
flutter_application_path = 'flutter_module/.ios/Flutter/podhelper.rb'
eval(File.read(File.join(flutter_application_path)), binding)
end
我也尝试过
flutter_application_path = 'flutter_module'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
此外,该文件位于
flutter_module/.ios/Flutter/podhelper.rb
请帮助。预先感谢。
答案 0 :(得分:2)
我知道了。我删除了podfile,并在项目目录中重新初始化了pod,并更改了
flutter_application_path = 'flutter_module'
到
flutter_application_path = 'flutter_module/'
最后注意'/'。
安装Pod之后现在
Analyzing dependencies
Fetching podspec for `Flutter` from `flutter_module/.ios/Flutter/engine`
Fetching podspec for `FlutterPluginRegistrant` from `flutter_module/.ios/Flutter/FlutterPluginRegistrant`
Downloading dependencies
Installing Flutter (1.0.0)
Installing FlutterPluginRegistrant (0.0.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
[!] Automatically assigning platform `ios` with version `12.2` on target `FlutteriOSApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
答案 1 :(得分:0)
答案 2 :(得分:0)
我刚刚使用了这些命令:
flutter clean
flutter pub get
flutter precache
cd ios
pod install
我希望这对你有用。快乐编码!