Flutter Podfile 未正确创建
我创建了一个新的颤振项目。这是我的 pubspec.yaml 文件:
name: app_name
description: App Name
version: 1.0.0+1
environment:
sdk: ">=2.16.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^7.3.1
flutter_localizations:
sdk: flutter
get_it: ^7.1.3
floor: ^1.2.0
flutter_speed_dial: ^5.0.0+1
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_launcher_icons: ^0.9.2
floor_generator: ^1.2.0
build_runner: ^2.1.2
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/logo.png"
flutter:
uses-material-design: true
module:
androidX: true
androidPackage: com.example.appname
iosBundleIdentifier: com.example.appname
当我运行以下命令时:
flutter pub get
pod初始化 pod install
podfile 已创建,但仅包含以下内容:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
当我尝试运行该应用程序时,出现以下错误: 沙箱与 Podfile.lock 不同步。运行“pod install”或更新您的 CocoaPods 安装
有人知道我该如何解决这个问题吗?
I created a new flutter project. This is my pubspec.yaml file:
name: app_name
description: App Name
version: 1.0.0+1
environment:
sdk: ">=2.16.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^7.3.1
flutter_localizations:
sdk: flutter
get_it: ^7.1.3
floor: ^1.2.0
flutter_speed_dial: ^5.0.0+1
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_launcher_icons: ^0.9.2
floor_generator: ^1.2.0
build_runner: ^2.1.2
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/logo.png"
flutter:
uses-material-design: true
module:
androidX: true
androidPackage: com.example.appname
iosBundleIdentifier: com.example.appname
When I run the following commands:
flutter pub get
pod init
pod install
The podfile is created, but only with the following contents:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
When I try to run the app, I get the following error:The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation
Anyone knows how I can fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先清除首选项中的派生数据并将其从垃圾箱中删除
然后使用以下命令
flutter clean
flutter pub get
cd ios
pod install
pod update
First clear Derived data from preference and remove it from bin as well
then use following commands
flutter clean
flutter pub get
cd ios
pod install
pod update