在从 Xcode 验证和分发应用程序时,一切都以消息“您无法使用当前 Xcode 上传应用程序”开始。
https://developer.apple.com/news/upcoming-requirements/?id=04292024a
不幸的是我在29号尝试过;如果我早一天尝试,我就不必处理这个......
我将 Xcode 更新到 15(这还需要将我的 MacOS 更新到 Sonoma - 正如您所理解的,我们同时进行了两项更改),并且在过去 3 天里我尝试了所有可以想象的解决方案。我不记得以前曾为一个问题如此挣扎过。我已经尝试了 20 多种解决方案,但始终遇到如下错误:
'SDK 路径中不包含'libarclite''
或
词法或预处理器问题(Xcode):找不到“Flutter/Flutter.h”文件(最后一个错误)
Podfile:(最终,我改了10多次,总是遇到问题)
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "11.0"
end
end
end
我该如何解决我的问题?
pubspec.yaml
name: example
description: example.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.5.3+18
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
badges: ^2.0.1
cached_network_image: ^3.0.0
cloud_firestore: ^2.3.0
cupertino_icons: ^1.0.3
dots_indicator: ^2.0.0
easy_localization: ^3.0.0
firebase_auth: ^2.0.0
firebase_core: ^1.3.0
firebase_messaging: ^10.0.3
firebase_storage: ^9.0.0
flutter_web_browser: ^0.14.0
flutter_html: any
#flutter_html: ^2.1.0
flutter_widget_from_html: ^0.8.5
#flutter_widget_from_html: ^0.6.1
google_fonts: ^2.1.0
google_sign_in: ^5.0.4
html: ^0.15.0
html_unescape: ^2.0.0
image_picker: ^0.8.1+3
intl: ^0.17.0
introduction_screen: ^2.1.0
launch_review: ^3.0.1
line_icons: ^2.0.1
lottie: ^1.1.0
package_info: ^2.0.2
path_provider: ^2.0.2
provider: ^6.0.0
#provider: ^5.0.0
share: ^2.0.4
shared_preferences: ^2.0.6
skeleton_text: ^3.0.0
fluttertoast: ^8.0.7
url_launcher: ^6.0.9
youtube_player_flutter: ^8.0.0
youtube_plyr_iframe: ^2.0.7
rounded_loading_button: ^2.0.5
firebase_analytics: ^8.1.2
flutter_facebook_auth: ^3.5.0
the_apple_sign_in: ^1.1.1
video_player: ^2.1.10
#flick_video_player: ^0.3.1
flutter_icons:
git:
url: https://github.com/adarsh-technocrat/flutter-icons
md2_tab_indicator:
git:
url: https://github.com/westdabestdb/md2_tab_indicator
purchases_flutter: ^4.10.3
dependency_overrides:
flutter_math_fork: ^0.6.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.9.0"
flutter_icons:
android: "launcher_icon"
ios: true
remove_alpha_ios: true #added later.
image_path: "assets/images/icon.png"
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- assets/images/
- assets/animation_files/
- assets/translations/
fonts:
- family: Poppins
fonts:
- asset: assets/fonts/Poppins-Light.ttf
weight: 400
- asset: assets/fonts/Poppins-Regular.ttf
weight: 500
- asset: assets/fonts/Poppins-Medium.ttf
weight: 600
- asset: assets/fonts/Poppins-SemiBold.ttf
weight: 700
- asset: assets/fonts/Poppins-Bold.ttf
weight: 800
- family: Open Sans
fonts:
- asset: assets/fonts/OpenSans-Light.ttf
weight: 400
- asset: assets/fonts/OpenSans-Regular.ttf
weight: 500
- family: Manrope
fonts:
# - asset: assets/fonts/Manrope-Light.ttf
# weight: 300
- asset: assets/fonts/Manrope-Regular.ttf
weight: 400
- asset: assets/fonts/Manrope-SemiBold.ttf
weight: 500
- asset: assets/fonts/Manrope-Medium.ttf
weight: 600
- asset: assets/fonts/Manrope-Bold.ttf
weight: 700
- asset: assets/fonts/Manrope-ExtraBold.ttf
weight: 900
使用 Xcode 15 通过 Flutter 开发 iOS 应用程序似乎可能成为过去。
Flutter 3.3.4
Dart 2.18.2
我终于解决了我的问题...我做了什么?
升级到Xcode15后,我认为问题可能与我的Flutter和Cocoapods版本有关。
终于,我的项目可以在真实的iPhone和模拟器中运行了。
感谢SO平台。