fluttercandies / flutter_photo_manager

A Flutter plugin that provides images, videos, and audio abstraction management APIs without interface integration, available on Android, iOS, macOS and OpenHarmony.
https://pub.dev/packages/photo_manager
Apache License 2.0
671 stars 303 forks source link

[Bug report] The new project failed to compile #1171

Closed akkagao closed 1 month ago

akkagao commented 1 month ago

Version

photo_manager: ^3.2.2

Platforms

iOS

Device Model

iPhone15(ios17.5)

flutter info

[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64 (Rosetta), locale zh-Hans-CN)
    • Flutter version 3.22.3 on channel stable at /Users/mobvista/software/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (3 周前), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2022.1.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.92.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.94.0

[✓] Connected device (4 available)
    • iPhone 15 (mobile)              • 1EEFE1C5-D1C0-4BAE-944D-C38F5134CBF5 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.5 23F79 darwin-arm64 (Rosetta)
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.5 23F79 darwin-arm64 (Rosetta)
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 127.0.6533.89
    ! Error: Browsing on the local area network for CrazyWolf. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

How to reproduce?

The new project import"photo_manager" failed to compile

cupertino_icons: ^1.0.6 get: 4.6.6 photo_manager: ^3.2.2 flutter: sdk: flutter

Logs

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

               ### Command

               /usr/local/bin/pod install --verbose
           ### Report

           * What did you do?

           * What did you expect to happen?

           * What happened instead?

           ### Stack

           ```
              CocoaPods : 1.15.2
                   Ruby : ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin23]
               RubyGems : 3.0.3.1
                   Host : macOS 14.5 (23F79)
                  Xcode : 15.4 (15F31d)
                    Git : git version 2.45.1
           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.5
           cocoapods-plugins     : 1.0.0
           cocoapods-search      : 1.0.1
           cocoapods-trunk       : 1.6.0
           cocoapods-try         : 1.2.0
           ```

           ### Podfile

           # 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__))
             target 'RunnerTests' do
               inherit! :search_paths
             end
           end

           post_install do |installer|
             installer.pods_project.targets.each do |target|
               flutter_additional_ios_build_settings(target)
             end
           end
           ```

           ### Error

           ```
           REXML::ParseException - #<TypeError: wrong argument type String (expected Regexp)>
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/source.rb:220:in `scan'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/source.rb:220:in `match'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/baseparser.rb:227:in `pull_event'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/baseparser.rb:207:in `pull'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/treeparser.rb:23:in `parse'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:448:in `build'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:101:in `initialize'
           /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `new'
           /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `from_s'
           /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:66:in `new_from_xcworkspace'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:102:in `create_workspace'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:71:in `integrate!'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:929:in `block in integrate_user_project'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:925:in `integrate_user_project'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:185:in `integrate'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in `install!'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
           /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
           /usr/local/bin/pod:23:in `load'
           /usr/local/bin/pod:23:in `<main>'
           ...
           wrong argument type String (expected Regexp)
           Line: 1
           Position: 38
           Last 80 unconsumed characters:
           <?xml version="1.0" encoding="UTF-8"?>
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/treeparser.rb:96:in `rescue in parse'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/parsers/treeparser.rb:21:in `parse'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:448:in `build'
           /Library/Ruby/Gems/2.6.0/gems/rexml-3.2.9/lib/rexml/document.rb:101:in `initialize'
           /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `new'
           /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:83:in `from_s'
           /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.24.0/lib/xcodeproj/workspace.rb:66:in `new_from_xcworkspace'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:102:in `create_workspace'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/user_project_integrator.rb:71:in `integrate!'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:929:in `block in integrate_user_project'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:925:in `integrate_user_project'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:185:in `integrate'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in `install!'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
           /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
           /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/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=%23%3CTypeError%3A+wrong+argument+type+String+%28expected+Regexp%29%3E%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2Fsource.rb

%3A220%3Ain+%60scan%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2Fsource.rb%3A220%3Ain+%60match%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2F

parsers%2Fbaseparser.rb%3A227%3Ain+%60pull_event%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2Fparsers%2Fbaseparser.rb%3A207%3Ain+%60pull%27%0A%2FLibrary%2FRuby%2FGems%2F2

.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2Fparsers%2Ftreeparser.rb%3A23%3Ain+%60parse%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2Fdocument.rb%3A448%3Ain+%60build%27%0A%2F

Library%2FRuby%2FGems%2F2.6.0%2Fgems%2Frexml-3.2.9%2Flib%2Frexml%2Fdocument.rb%3A101%3Ain+%60initialize%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fxcodeproj-1.24.0%2Flib%2Fxcodeproj%2Fworkspace.rb

%3A83%3Ain+%60new%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fxcodeproj-1.24.0%2Flib%2Fxcodeproj%2Fworkspace.rb%3A83%3Ain+%60from_s%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fxcodeproj-1.24.0%2

Flib%2Fxcodeproj%2Fworkspace.rb%3A66%3Ain+%60new_from_xcworkspace%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Finstaller%2Fuser_project_integrator.rb%3A102%3Ain+

%60create_workspace%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Finstaller%2Fuser_project_integrator.rb%3A71%3Ain+%60integrate%21%27%0A%2FLibrary%2FRuby%2FGems%2

F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Finstaller.rb%3A929%3Ain+%60block+in+integrate_user_project%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Fuser

_interface.rb%3A64%3Ain+%60section%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Finstaller.rb%3A925%3Ain+%60integrate_user_project%27%0A%2FLibrary%2FRuby%2FGems%2

F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Finstaller.rb%3A185%3Ain+%60integrate%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Finstaller.rb%3A170%3Ain+%6

0install%21%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Fcommand%2Finstall.rb%3A52%3Ain+%60run%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fclaide-1.1.0%2Flib%

2Fclaide%2Fcommand.rb%3A334%3Ain+%60run%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fcocoapods-1.15.2%2Flib%2Fcocoapods%2Fcommand.rb%3A52%3Ain+%60run%27%0A%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fc

ocoapods-1.15.2%2Fbin%2Fpod%3A55%3Ain+%60%3Ctop+%28required%29%3E%27%0A%2Fusr%2Flocal%2Fbin%2Fpod%3A23%3Ain+%60load%27%0A%2Fusr%2Flocal%2Fbin%2Fpod%3A23%3Ain+%60%3Cmain%3E%27%0A...%0Awrong+argument+ty pe+String+%28expected+Regexp%29%0ALine%3A+1%0APosition%3A+38%0ALast+80+unconsumed+characters%3A%0A%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E&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...

[ +7 ms] Error output from CocoaPods: ↳ [ ] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb:21: warning: Insecure world writable dir /Users/mobvista/workspace/jianwen/photo_cloud in PATH, mode 040777 Searching for inspections failed: undefined method `map' for nil:NilClass

           [!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See
           `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[ +2 ms] Error running pod install [ +1 ms] Error launching application on iPhone 15. [ +2 ms] "flutter run" took 11,108ms. [ +25 ms]

0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)

       #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:840:9)
       <asynchronous suspension>
       #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
       <asynchronous suspension>
       #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
       <asynchronous suspension>
       #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
       <asynchronous suspension>
       #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
       <asynchronous suspension>
       #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
       <asynchronous suspension>
       #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
       <asynchronous suspension>
       #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
       <asynchronous suspension>
       #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
       <asynchronous suspension>
       #10     main (package:flutter_tools/executable.dart:93:3)
       <asynchronous suspension>

[ +71 ms] ensureAnalyticsSent: 70ms [ ] Running 1 shutdown hook [ +3 ms] Shutdown hooks complete [ +63 ms] exiting with code 1


### Example code (optional)

```Dart
cupertino_icons: ^1.0.6
  get: 4.6.6
  photo_manager: ^3.2.2
  flutter: 
    sdk: flutter

Contact

870027589@qq.com

akkagao commented 1 month ago

The Ruby version is too old; install the latest version of Ruby using RVM.