Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run on MAC #13

Open
jonahzheng opened this issue Jul 17, 2020 · 2 comments
Open

Cannot run on MAC #13

jonahzheng opened this issue Jul 17, 2020 · 2 comments

Comments

@jonahzheng
Copy link

Your environment.

os: macos mojave 10.14.5

What did you do?

lvzx% flutter run -d macos

What did you expect?

It works on a MAC

What happened?

lvzx% flutter run -d macos
Flutter assets will be downloaded from http://mirrors.cnnic.cn/flutter. Make sure you trust this source!
Downloading darwin-x64/FlutterMacOS.framework tools... 12.8s
Downloading darwin-x64-profile/FlutterMacOS.framework tools... 3.9s
Downloading darwin-x64-profile tools... 5.4s
Downloading darwin-x64-release/FlutterMacOS.framework tools... 4.1s
Downloading darwin-x64-release tools... 4.1s
Launching lib/main.dart on macOS in debug mode...
Running pod install... 29.1s
CocoaPods' output:

Preparing

Analyzing dependencies

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

Fetching external sources
-> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`
-> Fetching podspec for `flutter_webrtc` from `Flutter/ephemeral/.symlinks/plugins/flutter_webrtc/macos`
-> Fetching podspec for `shared_preferences` from `Flutter/ephemeral/.symlinks/plugins/shared_preferences/macos`
-> Fetching podspec for `shared_preferences_macos` from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update

Comparing resolved specification to the sandbox manifest
  A FlutterMacOS
  A flutter_webrtc
  A shared_preferences
  A shared_preferences_macos

Downloading dependencies

-> Installing FlutterMacOS (1.0.0)

-> Installing flutter_webrtc (0.2.2)

-> Installing shared_preferences (0.0.1)

-> Installing shared_preferences_macos (0.0.1)
  - Running pre install hooks

Generating Pods project
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update

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

### Command

```
/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/bin/pod install --verbose
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.8.4
        Ruby : ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-darwin14.0.0]
    RubyGems : 2.4.7
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 11.3 (11C29)
         Git : git version 2.21.0
Ruby lib dir : /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib
Repositories : master-1 - git - https://github.com/CocoaPods/Specs.git @ 22d361b5e8e5029a14bae04b1258a083ae494885
               trunk - CDN - https://cdn.cocoapods.org/
```

### Plugins

```
cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0
```

### Podfile

```ruby
platform :osx, '10.11'

# 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
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |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)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

def pubspec_supports_macos(file)
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return false;
  end
  File.foreach(file_abs_path) { |line|
    return true if line =~ /^\s*macos:/
  }
  return false
end

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  ephemeral_dir = File.join('Flutter', 'ephemeral')
  symlink_dir = File.join(ephemeral_dir, '.symlinks')
  symlink_plugins_dir = File.join(symlink_dir, 'plugins')
  system("rm -rf #{symlink_dir}")
  system("mkdir -p #{symlink_plugins_dir}")

  # Flutter Pods
  generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig'))
  if generated_xcconfig.empty?
    puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  end
  generated_xcconfig.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join(symlink_dir, 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join(symlink_plugins_dir, p[:name])
    File.symlink(p[:path], symlink)
    if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml'))
      pod p[:name], :path => File.join(symlink, 'macos')
    end
  }
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
```

### Error

```
LoadError - library not found for class Digest::SHA256 -- digest/sha2.so
/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/digest.rb:12:in `const_missing'
/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/digest.rb:87:in `const_get'
/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/digest.rb:87:in `Digest'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/project.rb:47:in `initialize'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:82:in `new'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:82:in
`create_project'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:73:in
`generate!'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:16:in `generate!'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:308:in `block in create_and_save_projects'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:303:in `create_and_save_projects'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:294:in `generate_pods_project'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:173:in `integrate'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:162:in `install!'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/bin/pod:23:in `load'
/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/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=library+not+found+for+class+Digest%3A%3ASHA256+--+digest%2Fsha2.so&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...

Error output from CocoaPods:

/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require': dlopen(/Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/x86_64-darwin14.0.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError) Referenced from: /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/x86_64-darwin14.0.0/openssl.bundle Reason: image not found - /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/x86_64-darwin14.0.0/openssl.bundle from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/openssl.rb:17:in <top (required)>' from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/net/http.rb:890:in connect'
from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/net/http.rb:862:in do_start' from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/net/http.rb:851:in start'
from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/net/http.rb:1367:in request' from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/gh_inspector-1.1.3/lib/gh_inspector/sidekick.rb:84:in get_api_results'
from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/gh_inspector-1.1.3/lib/gh_inspector/sidekick.rb:28:in search' from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/gh_inspector-1.1.3/lib/gh_inspector/inspector.rb:68:in search_query'
from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/gh_inspector-1.1.3/lib/gh_inspector/inspector.rb:62:in search_exception' from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/user_interface/error_report.rb:119:in search_for_exceptions'
from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:67:in report_error' from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/claide-1.0.3/lib/claide/command.rb:396:in handle_exception'
from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/claide-1.0.3/lib/claide/command.rb:337:in rescue in run' from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/claide-1.0.3/lib/claide/command.rb:325:in run'
from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in run' from /Users/lvzx/.rvm/gems/ruby-2.0.0-p598@global/gems/cocoapods-1.8.4/bin/pod:55:in <top (required)>'
from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/bin/pod:23:in load' from /Users/lvzx/.rvm/rubies/ruby-2.0.0-p598/bin/pod:23:in

'

Exception: Error running pod install

@cloudwebrtc
Copy link
Contributor

Make sure to use flutterd ev channel, you can try to run flutter clean and then run again, and if it is running in China, you need to check whether CocoaPods can be updated normally

@ajayMishra1
Copy link

Which server you are using .
Pionion.org is not working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants