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

在mac上进行pod install时报错 No such file or directory fijkplayer.podspec.json #63

Closed
byerman opened this issue Sep 28, 2019 · 16 comments

Comments

@byerman
Copy link

byerman commented Sep 28, 2019

报错信息如下
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/apple/code/IH_MT/IH_MT/ios/Pods/FIJKPlayer/IJKPlayer.framework)
然后看了一下别人的解决方案
在spec文档中添加s.static_framework=true时
报了另外一个错误
no file found Fijkplayer. json
我使用的版本是0.1.4

@befovy
Copy link
Owner

befovy commented Sep 28, 2019

@byerman 你好,谢谢关注,fijkplayer 没有 0.1.4 版本,请使用 0.1.5 版本

@befovy befovy added the help wanted Extra attention is needed label Sep 29, 2019
@byerman
Copy link
Author

byerman commented Sep 29, 2019

这是具体的运行日志
Launching lib/main.dart on iPhone6 in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 87KL72D9QW
Running pod install...
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 `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `fijkplayer` from `.symlinks/plugins/fijkplayer/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_9_5_c.txt exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/9/5/c/FIJKPlayer/0.3.8/FIJKPlayer.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/9/5/c/FIJKPlayer/0.3.8/FIJKPlayer.podspec.json exists! Returning local because checking is only perfomed in repo update

Comparing resolved specification to the sandbox manifest
  A FIJKPlayer
  A Flutter
  A fijkplayer

Downloading dependencies

-> Installing FIJKPlayer (0.3.8)
  > Copying FIJKPlayer from `/Users/apple/Library/Caches/CocoaPods/Pods/Release/FIJKPlayer/0.3.8-48af5` to `Pods/FIJKPlayer`

-> Installing Flutter (1.0.0)

-> Installing fijkplayer (0.1.5)
  - Running pre install hooks

Generating Pods project
  - Creating Pods project
  - Installing files into Pods project
    - Adding source files
    - Adding frameworks
    - Adding libraries
    - Adding resources
    - Adding development pod helper files
    - Linking headers
  - Installing Pod Targets
    - Installing target `FIJKPlayer` iOS 8.0
    - Installing target `Flutter` iOS 8.0
    - Installing target `fijkplayer` iOS 8.0
      - Generating module map file at `Pods/Target Support Files/fijkplayer/fijkplayer.modulemap`
      - Generating umbrella header at `Pods/Target Support Files/fijkplayer/fijkplayer-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support Files/fijkplayer/fijkplayer-Info.plist`
      - Generating dummy source at `Pods/Target Support Files/fijkplayer/fijkplayer-dummy.m`
  - Installing Aggregate Targets
    - Installing target `Pods-Runner` iOS 8.0
      - Generating Info.plist file at `Pods/Target Support Files/Pods-Runner/Pods-Runner-Info.plist`
      - Generating module map file at `Pods/Target Support Files/Pods-Runner/Pods-Runner.modulemap`
      - Generating umbrella header at `Pods/Target Support Files/Pods-Runner/Pods-Runner-umbrella.h`
      - Generating dummy source at `Pods/Target Support Files/Pods-Runner/Pods-Runner-dummy.m`
  - Generating deterministic UUIDs
  - Stabilizing target UUIDs
  - Running post install hooks
    - Podfile
  - Writing Xcode project file to `Pods/Pods.xcodeproj`
  Cleaning up sandbox directory
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update

――― 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.8.1
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 10.3 (10G8)
         Git : git version 2.20.1 (Apple Git-117)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ a4132a4e9de23c1ba0ffe9265bd5c3e23939edbd
               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.0
cocoapods-try         : 1.1.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
  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

target 'Runner' do
  use_frameworks!

  # 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')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :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('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end
```

### Error

```
Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/apple/AndroidStudioProjects/flutter_demo/ios/Pods/Local Podspecs/fijkplayer.podspec.json
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/specification.rb:646:in `read'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/specification.rb:646:in `checksum'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:533:in `block in generate_checksums'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:532:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:532:in `generate_checksums'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:428:in `generate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:744:in `generate_lockfile'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:752:in `write_lockfiles'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:173:in `integrate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
```

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

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=No+such+file+or+directory+%40+rb_sysopen+-+%2FUsers%2Fapple%2FAndroidStudioProjects%2Fflutter_demo%2Fios%2FPods%2FLocal+Podspecs%2Ffijkplayer.podspec.json&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...
Found no similar issues. To create a new issue, please visit:
https://github.com/cocoapods/cocoapods/issues/new

Error output from CocoaPods:

[!] Automatically assigning platform `iOS` with version `8.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`.

Finished with error: Error running pod install

@CaiJingLong
Copy link

CaiJingLong commented Sep 29, 2019

给出的日志是这样的, 这意思是 cocoapod 中报出来的错误.

核心错误是说文件找不到 ENOENT - No such file or directory @ rb_sysopen - /Users/apple/AndroidStudioProjects/flutter_demo/ios/Pods/Local Podspecs/fijkplayer.podspec.json

所以如果你 ios 文件中如果没有进行过修改, 是不是可以尝试删除掉 ios 文件夹
然后在项目根目录下重新执行 flutter create . 来重新创建 ios 目录(删除前请备份)

接着执行

flutter packages get
cd ios
pod install 重新尝试

如果还不行 把你的TEMPLATE STARTTEMPLATE END之间的内容发到 cocoapod 的 issue 里看看能否得到解决

以下是你的日志


Command

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

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.8.1
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 10.3 (10G8)
         Git : git version 2.20.1 (Apple Git-117)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ a4132a4e9de23c1ba0ffe9265bd5c3e23939edbd
               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.0
cocoapods-try         : 1.1.0

Podfile

# 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
  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

target 'Runner' do
  use_frameworks!

  # 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')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :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('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Error

Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/apple/AndroidStudioProjects/flutter_demo/ios/Pods/Local Podspecs/fijkplayer.podspec.json
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/specification.rb:646:in `read'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/specification.rb:646:in `checksum'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:533:in `block in generate_checksums'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:532:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:532:in `generate_checksums'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:428:in `generate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:744:in `generate_lockfile'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:752:in `write_lockfiles'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:173:in `integrate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

@byerman
Copy link
Author

byerman commented Sep 29, 2019

给出的日志是这样的, 这意思是 cocoapod 中报出来的错误.

核心错误是说文件找不到 ENOENT - No such file or directory @ rb_sysopen - /Users/apple/AndroidStudioProjects/flutter_demo/ios/Pods/Local Podspecs/fijkplayer.podspec.json

所以如果你 ios 文件中如果没有进行过修改, 是不是可以尝试删除掉 ios 文件夹
然后在项目根目录下重新执行 flutter create . 来重新创建 ios 目录(删除前请备份)

接着执行

flutter packages get
cd ios
pod install 重新尝试

如果还不行 把你的TEMPLATE STARTTEMPLATE END之间的内容发到 cocoapod 的 issue 里看看能否得到解决

以下是你的日志

你好,谢谢你的回复
按照你的做法,还是报一样的错误,我决定把这个问题报到cocoapod那边。
同时希望有碰到相同问题的人,在这里看到了这个问题,能解答一下

@jinsong5

This comment has been minimized.

@jinsong5
Copy link
Contributor

jinsong5 commented Nov 1, 2019

CocoaPods/CocoaPods#9214

在这个issue查到了问题所在,是因为cocoapods版本导致,我目前的版本是1.8.1,将其降级为1.7.5就可以了。
降级方法:
首先查看下本地的cocoapods版本
-- gem list --local | grep cocoapods
如果有多个版本,删除高版本,留下1.7.5,我的是1.8.1
-- gem uninstall cocoapods -v 1.8.1
-- sudo gem install cocoapods -v 1.7.5

然后重新pod install 就可以了,不过由于依赖下载慢,所以如果公司wifi不是很好建议有条件的用4G or 在家里下,
可以 pod install --verbose查看下载进度

@befovy
Copy link
Owner

befovy commented Nov 1, 2019

@all-contributors please add @jinsong5 for question

@allcontributors
Copy link
Contributor

@befovy

I've put up a pull request to add @jinsong5! 🎉

@befovy befovy removed the help wanted Extra attention is needed label Nov 1, 2019
@befovy befovy closed this as completed Nov 1, 2019
@context-ui
Copy link

context-ui commented Nov 2, 2019

@befovy
[!] Error installing FIJKPlayer
[!] /usr/bin/curl -f -L -o /var/folders/b5/rsxzl7753ml0c7sbcztjpglh0000gn/T/d20191102-18545-hdk0i8/file.tgz https://github.com/befovy/ijkplayer/releases/download/f0.3.8/FIJKPlayer.tar.gz --create-dirs --netrc-optional --retry 2

curl: (22) The requested URL returned error: 404 Not Found

问下这个是什么原因 FIJKPlayer.tar.gz地址不存在 pod install 报这个错了

@context-ui
Copy link

@befovy
这个我要修改什么配置文件吗?clone了example还是有同样问题

@befovy
Copy link
Owner

befovy commented Nov 4, 2019

@eleanors 我也没遇到或这个问题,建议清空 flutter 缓存,清空 pub 缓存,清空 pod 缓存。清空缓存后重试看看

@context-ui
Copy link

@befovy
都清除过了 不行 修改了symlinks/plugins/fijkplayer/ios/fijkplayer.podspecs文件里面的 .dependency 'FIJKPlayer', '~> 0.3.8'的依赖名称为【IJKPlayer】再运行直接报错
或者是手动下载 FIJKPlayer.tar.gz文件 你知不知道要放在哪里?

@CaiJingLong
Copy link

$ pod install --verbose, 其中下载的步骤会根据库中定义的不同, http使用curl进行下载, git则通过git clone的方式, 那里会指定一个临时目录来完成这步, 如果打开了--verbose可以看到本地目录的具体地址.

但我的建议是, 你如果确实不知道如何去完成这一步的依赖方式, 可以下载库后, 将本库作为一个本地的package来引入 flutter 项目.

@befovy
Copy link
Owner

befovy commented Nov 12, 2019

@all-contributors please add @CaiJingLong for question

@allcontributors
Copy link
Contributor

@befovy

I've put up a pull request to add @CaiJingLong! 🎉

@befovy befovy changed the title 在mac上进行pod install时报错 在mac上进行pod install时报错 No such file or directory fijkplayer.podspec.json Nov 26, 2019
@befovy befovy mentioned this issue Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants