升级到 flutter 3.0.1 后更新 CocoaPods 时出错

2024-03-12

我在用MacBook Pro,M1 芯片. OS is MacOS 蒙特利 12.3.1

今天我将flutter从2.5.4升级到3.0.1。

我可以在 Android 中完美运行我的项目。但是在 iOS 中我收到以下错误。

Launching lib/main.dart on iPhone SE (3rd generation) in debug mode...
Warning: CocoaPods recommended version 1.11.0 or greater not installed.
Pods handling may fail on some projects involving plugins.
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Finding Podfile changes
      A google_sign_in_ios
      A image_picker_ios
      A url_launcher_ios
      R amazon_s3_cognito
      R google_sign_in
      R image_picker
      R url_launcher
      - Flutter
      - cloud_firestore
      - file_picker
      - firebase_auth
      - firebase_core
      - firebase_messaging
      - firebase_storage
      - flutter_image_compress
      - flutter_keyboard_visibility
      - flutter_pdfview
      - geolocator_apple
      - google_maps_flutter
      - image_cropper
      - maps_launcher
      - open_file
      - path_provider_ios
      - shared_preferences_ios
      - sqflite
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `file_picker` from `.symlinks/plugins/file_picker/ios`
    -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
    firebase_auth: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
    firebase_messaging: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
    firebase_storage: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `flutter_image_compress` from `.symlinks/plugins/flutter_image_compress/ios`
    -> Fetching podspec for `flutter_keyboard_visibility` from `.symlinks/plugins/flutter_keyboard_visibility/ios`
    -> Fetching podspec for `flutter_pdfview` from `.symlinks/plugins/flutter_pdfview/ios`
    -> Fetching podspec for `geolocator_apple` from `.symlinks/plugins/geolocator_apple/ios`
    -> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/ios`
    -> Fetching podspec for `google_sign_in_ios` from `.symlinks/plugins/google_sign_in_ios/ios`
    -> Fetching podspec for `image_cropper` from `.symlinks/plugins/image_cropper/ios`
    -> Fetching podspec for `image_picker_ios` from `.symlinks/plugins/image_picker_ios/ios`
    -> Fetching podspec for `maps_launcher` from `.symlinks/plugins/maps_launcher/ios`
    -> Fetching podspec for `open_file` from `.symlinks/plugins/open_file/ios`
    -> Fetching podspec for `path_provider_ios` from `.symlinks/plugins/path_provider_ios/ios`
    -> Fetching podspec for `shared_preferences_ios` from `.symlinks/plugins/shared_preferences_ios/ios`
    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
    -> Fetching podspec for `url_launcher_ios` from `.symlinks/plugins/url_launcher_ios/ios`
    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.11.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_1_6_1.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/1/6/1/DKImagePickerController/4.3.2/DKImagePickerController.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/1/6/1/DKImagePickerController/4.3.2/DKImagePickerController.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_a_d_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/a/d/d/GoogleMaps/5.1.0/GoogleMaps.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/6.1.0/GoogleSignIn.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_3_7_4.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/3/7/4/TOCropViewController/2.6.1/TOCropViewController.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_5_d_c.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/5/d/c/Mantle/2.2.0/Mantle.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_1_1_7.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/1/1/7/SDWebImage/5.12.2/SDWebImage.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_e_9_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/e/9/d/SDWebImageWebPCoder/0.8.4/SDWebImageWebPCoder.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_f_4_e.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.podspec.json exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
      In Podfile:
        google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) was resolved to 0.0.1, which depends on
          GoogleSignIn (~> 6.2)
    None of your spec sources contain a spec satisfying the dependency: `GoogleSignIn (~> 6.2)`.
    You have either:
     * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
     * mistyped the name or version.
     * not added the source repo that hosts the Podspec to your Podfile.
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
    Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Error running pod install
Error launching application on iPhone SE (3rd generation).
Exited

I tried pod installios文件夹里面。下面是输出。

Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
  In Podfile:
    google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) was resolved to 0.0.1, which depends on
      GoogleSignIn (~> 6.2)

None of your spec sources contain a spec satisfying the dependency: `GoogleSignIn (~> 6.2)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

I tried pod update下面是输出。

Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Update all pods
Updating local specs repositories

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

### Command

```
/usr/local/bin/pod update
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.10.1
        Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
    RubyGems : 3.0.3.1
        Host : macOS 12.3.1 (21E258)
       Xcode : 13.4 (13F17a)
         Git : git version 2.32.1 (Apple Git-133)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
```

### Plugins

```
cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.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, '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|
    flutter_additional_ios_build_settings(target)
  end
end
```

### Error

```
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:5:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.14.0/lib/ethon.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:78:in `deprecated_local_podspecs'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:60:in `preheat_existing_files'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:257:in `update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:135:in `block (3 levels) in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:134:in `block (2 levels) in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:133:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:133:in `block in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:131:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:131:in `update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:145:in `block in update_repositories'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:143:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:143:in `update_repositories'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/update.rb:63:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
```

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

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e%27%29%29+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle&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...
Searching for inspections failed: undefined method `map' for nil:NilClass

这是什么flutter doctor不得不说

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.1, on macOS 12.3.1 21E258 darwin-arm, locale
    en-LK)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 13.4)
    ! CocoaPods 1.10.1 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.67.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

几个月前,当在这个 M1 芯片中安装颤振时,我记得我必须解决类似的问题ffi。如果我没记错的话,我必须用另一个命令单独安装它。

我该如何解决这个问题?


这就是我必须做的..

首先,更新FFI

sudo arch -x86_64 gem install ffi

导航到项目的 ios 文件夹...

现在更新 M1 芯片的 Pod

arch -x86_64 pod update

现在为 M1 芯片安装 pod

arch -x86_64 pod install
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

升级到 flutter 3.0.1 后更新 CocoaPods 时出错 的相关文章

随机推荐

  • 列出所有不带星号的本地 git 分支 [重复]

    这个问题在这里已经有答案了 如果我跑git branch 我得到类似的东西 master dev foo if I do git branch r 它将显示远程上的所有分支 不带星号 其中星号显示我当前签出的分支 如何列出所有本地分支机构而
  • 在 appsettings.json 日志记录上下文中,MinimumLevel 和 Override 意味着什么?

    我正在查看 appsettings jsonSerilog 示例项目 https github com serilog serilog docker blob master web sample src appsettings json 其
  • python - 是否可以创建“def”列表? [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我想知道是否可以创建一个 def 列表 连接 20 个按钮的列表 并为每个按钮设置不同的回调 Thanks def在Python中只是
  • 自定义类扩展 FloatingActionButton 时出错

    我创建了一个自定义类并扩展了FloatingActionButton public class customFAB extends FloatingActionButton public customFAB Context context
  • 在 Pytorch 中执行优化时如何对变量应用界限?

    我正在尝试使用 Pytorch 进行非凸优化 试图最大化我的目标 因此在 SGD 中最小化 我想限制因变量 x gt 0 并且 x 值的总和小于 1000 我认为我已经以斜坡惩罚的形式正确实施了惩罚 但我正在努力解决 x 变量的边界问题 在
  • 表单提交 keyCode == "enter" (13)

    I need to submit the content of a form when I press the Enter key but only if the form has no error message I built up t
  • 如何在react中进行fetch?

    下午好 我从服务器获取json 我处理它 但是对渲染的调用发生了2次 Google 在构造函数中创建一个空对象 如果该对象没有属性 则返回 undefined 但我也有数组 应用程序从中崩溃 我附上代码 如何将数据取出状态 是否可以在渲染中
  • NSJSON序列化

    我在使用某些公共 json 服务时遇到问题 以这种方式格式化的服务 jsonFlickrFeed title Uploads from everyone link http www flickr com photos description
  • Android 本地化 es-r419

    我正在本地化我的应用程序 支持的语言 区域之一是 Espanol 419 Android 不支持命名约定values es r419 但它接受values en rGB 我应该使用什么名称才能使其正常工作 我不知道r419从何而来 我唯一能
  • 让左栏一直向下延伸

    我已经为此绞尽脑汁近三天了 我读过很多关于 3col 拉伸 设置清晰和使用绝对位置和相对位置的文章 很多是矛盾的 我认为 我想要一个非常简单的布局 我想要左侧的导航 div 左侧有两个 div 和一个页脚 如果我使用表格 它会是这样的 ta
  • 如何在不打开 Flutter 上默认电子邮件应用程序的情况下发送邮件?

    是否可以在不打开默认电子邮件应用程序的情况下发送电子邮件 直接地 我用了两个插件 但两者都是打开默认应用程序 Using flutter email sender plugin final Email email Email body Ve
  • 为什么我不能将 PHP 类实例存储为 SESSION 变量

    我有一个 PHP 脚本 可以通过 Dojo Ajax xhrGet 调用以两种方式进行调用 第一次使用 init 参数调用它 这会导致脚本创建 StateList 类的实例并读入状态名称文件 session start include St
  • 使用 Sharp 库的 Firebase 部署功能在 Google Cloud Build 中失败

    从 Bitbucket Pipelines 迁移到 Google Cloud Build 后 Firebase 部署失败 该设置在 Bitbucket Pipelines 和本地都成功部署 除了下面的错误之外 没有给出进一步的解释 我对代码
  • 如何启用码头登录?

    我正在尝试调试我的情况 其中简单的 ActiveWeb 应用程序未在 Jetty 下运行 它的行为就像不存在任何用于请求处理的类一样 并返回错误 404 问题不在于 ActiveWeb 这是关于杰蒂的 如何发现 Jetty 有一些 Web
  • 谷歌浏览器扩展:如何多次打开新的浏览器窗口?

    我的 Chrome 扩展程序使用这个简单的 JS 打开一个新的浏览器窗口 chrome browserAction onClicked addListener function tab var room new Date getTime w
  • ViewPager 使用视图而不是片段

    I ve a ViewPager现在使用Views代替Fragments显示每个选项卡 每个选项卡都会扩展相同的布局文件 Overview In this ViewPager 我应该将地雷添加为选项卡 因此基本上每个选项卡都对应于一个特定的
  • 如何不使用gopath导入本地包

    我用过GOPATH但对于我当前面临的这个问题 它没有帮助 我希望能够创建特定于项目的包 myproject binary1 go binary2 go package1 go package2 go 我尝试了多种方法 但如何得到packag
  • 无法在 Electron 应用程序中使用 Discord OAuth2

    我正在尝试创建一个 Electron 应用程序 使用 Electron net 和 MVC 并使用 Discord 的 OAuth2 进行用户登录 然而 当加载 OAuth2 页面时 Discord 认为我使用的 Discord 安装已损坏
  • 如何捕获远程系统网络流量?

    我一直在使用wire shark来分析socket程序的数据包 现在我想看看其他主机的流量 因为我发现我需要使用只有Linux平台支持的监控模式 所以我尝试了但我无法捕获在我的网络中传输的任何数据包 列为捕获的 0 个数据包 设想 我有一个
  • 升级到 flutter 3.0.1 后更新 CocoaPods 时出错

    我在用MacBook Pro M1 芯片 OS is MacOS 蒙特利 12 3 1 今天我将flutter从2 5 4升级到3 0 1 我可以在 Android 中完美运行我的项目 但是在 iOS 中我收到以下错误 Launching