ios - Flutter pod 安装问题和 ios 应用程序未运行

标签 ios flutter cocoapods

我尝试运行我的项目并在 Ios 上遇到此错误

在 iPhone 11 上以 Debug模式启动 lib/main.dart... 正在运行 Pod 安装... CocoaPods 的输出: ↳ 准备中

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Finding Podfile changes
  A background_fetch
  A connectivity
  A connectivity_for_web
  A connectivity_macos
  A devicelocale
  A esys_flutter_share
  A firebase_crashlytics
  A firebase_messaging
  A firebase_ml_vision
  A flutter_app_badger
  A flutter_background_geolocation
  A flutter_image_compress
  A flutter_local_notifications
  A flutter_plugin_android_lifecycle
  A image_picker
  A local_auth
  A location
  A location_web
  A package_info
  A path_provider
  A path_provider_linux
  A path_provider_windows
  A permission_handler
  A shared_preferences
  A shared_preferences_linux
  A shared_preferences_macos
  A shared_preferences_web
  A shared_preferences_windows
  A sqflite
  A url_launcher
  A url_launcher_linux
  A url_launcher_macos
  A url_launcher_web
  A url_launcher_windows
  - Firebase
  - Flutter

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `background_fetch` from `.symlinks/plugins/background_fetch/ios`
-> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios`
-> Fetching podspec for `connectivity_for_web` from `.symlinks/plugins/connectivity_for_web/ios`
-> Fetching podspec for `connectivity_macos` from `.symlinks/plugins/connectivity_macos/ios`
-> Fetching podspec for `devicelocale` from `.symlinks/plugins/devicelocale/ios`
-> Fetching podspec for `esys_flutter_share` from `.symlinks/plugins/esys_flutter_share/ios`
-> Fetching podspec for `firebase_crashlytics` from `.symlinks/plugins/firebase_crashlytics/ios`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

```
/Users/ashraf/.rvm/gems/ruby-2.6.1/bin/pod install --verbose
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.10.0.rc.1
        Ruby : ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin19]
    RubyGems : 3.0.8
        Host : Mac OS X 10.15.4 (19E287)
       Xcode : 12.0.1 (12A7300)
         Git : git version 2.20.1
Ruby lib dir : /Users/ashraf/.rvm/rubies/ruby-2.6.1/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
```

### Plugins

```
cocoapods-clean       : 0.0.1
cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0
```

### Podfile

```ruby
# Uncomment this line to define a global platform for your project
platform :ios, '9.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 parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  generated_key_values = {}
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) do |line|
    next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
    plugin = line.split(pattern=separator)
    if plugin.length == 2
      podname = plugin[0].strip()
      path = plugin[1].strip()
      podpath = File.expand_path("#{path}", file_abs_path)
      generated_key_values[podname] = podpath
    else
      puts "Invalid plugin specification: #{line}"
    end
  end
  generated_key_values
end

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # Flutter Pod

  copied_flutter_dir = File.join(__dir__, 'Flutter')
  copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
  copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
  unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
    # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
    # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
    # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.

    generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
    unless File.exist?(generated_xcode_build_settings_path)
      raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
    end
    generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
    cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];

    unless File.exist?(copied_framework_path)
      FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
    end
    unless File.exist?(copied_podspec_path)
      FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
    end
  end

  # Keep pod path relative so it can be checked into Podfile.lock.
  pod 'Flutter', :path => 'Flutter'

  # Plugin Pods

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.each do |name, path|
    symlink = File.join('.symlinks', 'plugins', name)
    File.symlink(path, symlink)
    pod name, :path => File.join(symlink, 'ios')
  end
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.0'  # required by simple_permission
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'


      # Here are some configurations automatically generated by flutter

      # You can remove unused permissions here
      # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/permission_handler/ios/Classes/PermissionHandlerEnums.h
      # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',

        ## dart: PermissionGroup.calendar
         'PERMISSION_EVENTS=0',

        ## dart: PermissionGroup.reminders
        'PERMISSION_REMINDERS=0',

        ## dart: PermissionGroup.contacts
        'PERMISSION_CONTACTS=0',

        ## dart: PermissionGroup.camera
        #'PERMISSION_CAMERA=0',

        ## dart: PermissionGroup.microphone
        # 'PERMISSION_MICROPHONE=0',

        ## dart: PermissionGroup.speech
         'PERMISSION_SPEECH_RECOGNIZER=0',

        ## dart: PermissionGroup.photos
        # 'PERMISSION_PHOTOS=0',

        ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
        # 'PERMISSION_LOCATION=0',

        ## dart: PermissionGroup.notification
        # 'PERMISSION_NOTIFICATIONS=0',

        ## dart: PermissionGroup.mediaLibrary
         'PERMISSION_MEDIA_LIBRARY=0',

        ## dart: PermissionGroup.sensors
         'PERMISSION_SENSORS=0'
      ]

    end
  end
end

pod 'Firebase/MLVisionFaceModel'
```

### Error

```
ArgumentError - Malformed version number string p.0
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/version.rb:47:in `initialize'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/vendor/version.rb:199:in `new'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/vendor/version.rb:199:in `new'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/vendor/version.rb:192:in `create'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/platform.rb:54:in `initialize'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/specification.rb:517:in `new'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/specification.rb:517:in `block in available_platforms'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/specification.rb:517:in `map'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/specification.rb:517:in `available_platforms'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-core-1.10.0.rc.1/lib/cocoapods-core/specification.rb:402:in `dependencies'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/validator.rb:44:in `initialize'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/external_sources/abstract_external_source.rb:201:in `new'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/external_sources/abstract_external_source.rb:201:in `validator_for_podspec'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/external_sources/abstract_external_source.rb:186:in `validate_podspec'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/external_sources/abstract_external_source.rb:178:in `store_podspec'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:989:in `fetch_external_source'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:968:in `block (2 levels) in fetch_external_sources'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:967:in `each'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:967:in `block in fetch_external_sources'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:966:in `fetch_external_sources'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:414:in `analyze'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:160:in `install!'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/ashraf/.rvm/rubies/ruby-2.6.1/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/command.rb:52:in `run'
/Users/ashraf/.rvm/gems/ruby-2.6.1/gems/cocoapods-1.10.0.rc.1/bin/pod:55:in `<top (required)>'
/Users/ashraf/.rvm/gems/ruby-2.6.1/bin/pod:23:in `load'
/Users/ashraf/.rvm/gems/ruby-2.6.1/bin/pod:23:in `<main>'
/Users/ashraf/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in `eval'
/Users/ashraf/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in `<main>'
```

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=Malformed+version+number+string+p.0&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - Trying to run flutter App on ios simulator give me this Error
   https://github.com/CocoaPods/CocoaPods/issues/10127 [open] [3 comments]
   3 hours ago

 - Error running pod install Error launching application on iPhone 11.
   https://github.com/CocoaPods/CocoaPods/issues/9981 [closed] [1 comment]
   16 Aug 2020

 - error when running pod install
   https://github.com/CocoaPods/CocoaPods/issues/9195 [closed] [4 comments]
   04 Oct 2019

and 1 more at:
https://github.com/cocoapods/cocoapods/search?q=Malformed%20version%20number%20string%20p.0&type=Issues&utf8=✓

运行 pod install 时出错 在 iPhone 11 上启动应用程序时出错。

和 pubspec.yaml 文件:

version: 3.8.8+107

environment:
  sdk: ">=2.2.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  devicelocale: ^0.2.1
  shared_preferences: ^0.5.6+1
  http: ^0.12.0+4
  #camera: ^0.4.0+1
  path_provider: ^1.6.0
  image_picker: 0.6.7
  uuid: ^2.0.0
  flutter_calendar_carousel: ^1.4.11
  url_launcher: ^5.4.5
  local_auth: ^0.6.1
  #onesignal: ^1.1.0
  connectivity: ^0.4.8+6
  flutter_picker: ^1.1.0
  location: ^3.0.2
  flutter_local_notifications: ^0.8.4
  firebase_messaging: ^6.0.9
  dotted_border: ^1.0.2
  intl: ^0.16.0
  cupertino_icons: ^0.1.2
  package_info: 0.4.0+6
  flutter_image_compress: ^0.6.3
  exif: ^1.0.1
  firebase_ml_vision: ^0.9.6+2
  collection: ^1.14.11
  responsive_grid: ^1.2.1+1
  flutter_background_geolocation: ^1.6.1
  flutter_fluid_slider: ^1.0.2
  esys_flutter_share: ^1.0.2
  photo_view: ^0.6.0
  mask_text_input_formatter: ^1.0.5
  auto_size_text: ^2.1.0
  crypto: ^2.1.3
  firebase_crashlytics: ^0.1.2+5
  cached_network_image: ^2.2.0+1
  flutter_linkify: ^3.1.3
  qr_flutter: ^3.1.0
  material_design_icons_flutter: ^4.0.5345
  permission_handler: ^5.0.0+hotfix.8
  flutter_app_badger: ^1.1.2
  awesome_dialog: ^1.1.3
  flutter_cache_manager: ^1.4.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^1.0.0


flutter:
  uses-material-design: true

  assets:
    - assets/
    - assets/images/
    - assets/fonts/
    - assets/langs/

  fonts:
    - family: poppins
      fonts:
        - asset: assets/fonts/Poppins-Regular.ttf
        - asset: assets/fonts/Poppins-Light.ttf
        - asset: assets/fonts/Poppins-Thin.ttf

最佳答案

  1. 将 Podfile 的 SWIFT_VERSION 更改为 5.0 怎么样?

    config.build_settings['SWIFT_VERSION'] = '4.0'

config.build_settings['SWIFT_VERSION'] = '5.0'
  • 您的 flutter sdk 版本是什么?
  • 关于ios - Flutter pod 安装问题和 ios 应用程序未运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64253935/

    相关文章:

    dart - Flutter:步进器 onStepContinue 未触发

    dart - 单击按钮后使文本小部件可见

    ruby - 安装 cocoapods 时出现 SSL 验证错误

    ios - 在使用 CocoaPods 编译期间包含目录作为搜索路径

    iOS - 不支持多次推送同一个 View Controller 实例

    ios - 运行代码时出错?

    iphone - 随着音乐应用程序播放歌曲播放无声视频

    ios - UICollectionViewCompositionalLayout 的背景 View 在哪个方法中出队

    android - 在步进 flutter 中管理多个表单(验证)

    ios - 在 iOS 中为 Today Extension(Widget) 安装 pods