tripleCC / cocoapods-bin

CocoaPods 组件二进制化辅助插件(双私有源)
MIT License
304 stars 54 forks source link

插件运行报错 #16

Closed zhangjianbin closed 4 years ago

zhangjianbin commented 4 years ago
def compile
        defines = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
        defines << ' ' << @spec.consumer(@platform).compiler_flags.join(' ')
       options = ios_build_options
        xcodebuild(defines, options)
        defines
end

defines << ' ' << @spec.consumer(@platform).compiler_flags.join(' ')这一行一直提示Frozen object is modify。我的ruby环境是2.6.3.

tripleCC commented 4 years ago
def compile
        defines = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
        defines << ' ' << @spec.consumer(@platform).compiler_flags.join(' ')
       options = ios_build_options
        xcodebuild(defines, options)
        defines
end

defines << ' ' << @spec.consumer(@platform).compiler_flags.join(' ')这一行一直提示Frozen object is modify。我的ruby环境是2.6.3.

能贴下 pod env 输出么

zhangjianbin commented 4 years ago

Stack

   CocoaPods : 1.7.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 11.3 (11C29)
         Git : git version 2.21.0 (Apple Git-122.2)
Ruby lib dir : /Users/liuyanchao/.rvm/rubies/ruby-2.6.3/lib

Installation Source

Executable Path: /Users/liuyanchao/.rvm/gems/ruby-2.6.3/bin/pod

Plugins

zhangjianbin commented 4 years ago

插件对pod版本要要求吗?1.6.1能用吗?

tripleCC commented 4 years ago

插件对pod版本要要求吗?1.6.1能用吗?

~> 1.4 就行,最新版本修复了,多谢反馈

zhangjianbin commented 4 years ago
截屏2020-01-19下午3 18 16

这个头文件有两份,一份也可以的吧?感觉只需要留下framework下的吧?

tripleCC commented 4 years ago
截屏2020-01-19下午3 18 16

这个头文件有两份,一份也可以的吧?感觉只需要留下framework下的吧?

这个只是两份引用,磁盘上只有一份,当时是解决直接 "" 引用头文件问题的一种方式,不影响实际使用

zhangjianbin commented 4 years ago

我正好也遇到了头文件引用的问题,在两份的情况下我尝试使用 #import "OCHooking.h" 这种方式引用头文件,但是这样引用不到。还是得加上路径 #import "OCHooking/OCHooking.h"或者#import <OCHooking/OCHooking.h>这两种方式才能引用上。如果想支持#import "OCHooking.h"这种方式的引用是还需要配置什么吗?

tripleCC commented 4 years ago

我正好也遇到了头文件引用的问题,在两份的情况下我尝试使用 #import "OCHooking.h" 这种方式引用头文件,但是这样引用不到。还是得加上路径 #import "OCHooking/OCHooking.h"或者#import <OCHooking/OCHooking.h>这两种方式才能引用上。如果想支持#import "OCHooking.h"这种方式的引用是还需要配置什么吗?

高版本 cocoapods 貌似变更了 user search paths 设置策略,所以在不动态更改相关配置的前提下,现在应该没法直接使用 "",如果量不大,推荐你都使用伞头文件,后续也方便直接使用 module @import

zhangjianbin commented 4 years ago

执行pod bin archive --use-modular-headers 报以下错误,插件是最新版。

Report

Stack

   CocoaPods : 1.6.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.14.6 (18G103)
       Xcode : 11.3 (11C29)
         Git : git version 2.21.0 (Apple Git-122.2)
Ruby lib dir : /Users/liuyanchao/.rvm/rubies/ruby-2.6.3/lib

Plugins

cocoapods-bin                         : 0.1.25
cocoapods-deintegrate                 : 1.0.4
cocoapods-disable-podfile-validations : 0.1.1
cocoapods-generate                    : 1.6.0
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

Error

NoMethodError - undefined method `all_dependencies' for nil:NilClass
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:570:in `block in edge_is_valid_for_target_platform?'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:575:in `edge_is_valid_for_target_platform?'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:551:in `block in add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:552:in `block in add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:552:in `block in add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:552:in `block in add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:552:in `block in add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:550:in `add_valid_dependencies_from_node'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:542:in `block in valid_dependencies_for_target'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:540:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:540:in `valid_dependencies_for_target'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:107:in `block (2 levels) in resolver_specs_by_target'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:104:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:104:in `block in resolver_specs_by_target'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:103:in `tap'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:103:in `resolver_specs_by_target'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/resolver.rb:95:in `call'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/resolver.rb:95:in `block in <class:Resolver>'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:92:in `resolve'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:909:in `block in resolve_dependencies'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:907:in `resolve_dependencies'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:114:in `analyze'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:266:in `analyze'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:174:in `block in resolve_dependencies'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:173:in `resolve_dependencies'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:136:in `install!'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/generate/installer.rb:57:in `block (3 levels) in install!'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/config.rb:41:in `with_changes'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/generate/installer.rb:54:in `block (2 levels) in install!'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/generate/installer.rb:53:in `block in install!'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:118:in `title'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/generate/installer.rb:40:in `install!'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/command/gen.rb:68:in `block in run'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/command/gen.rb:67:in `each'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-generate-1.6.0/lib/cocoapods/command/gen.rb:67:in `run'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/command/bin/archive.rb:69:in `block (3 levels) in generate_project'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/podfile_env.rb:28:in `execute_with_key'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/podfile_env.rb:21:in `execute_with_use_binaries'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/command/bin/archive.rb:56:in `block (2 levels) in generate_project'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/podfile_env.rb:28:in `execute_with_key'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/podfile_env.rb:17:in `execute_with_allow_prerelease'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/command/bin/archive.rb:55:in `block in generate_project'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/podfile_env.rb:28:in `execute_with_key'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/native/podfile_env.rb:13:in `execute_with_bin_plugin'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/command/bin/archive.rb:54:in `generate_project'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-bin-0.1.25/lib/cocoapods-bin/command/bin/archive.rb:45:in `run'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/bin/pod:23:in `load'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/bin/pod:23:in `<main>'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/Users/liuyanchao/.rvm/gems/ruby-2.6.3/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=undefined+method+%60all_dependencies%27+for+nil%3ANilClass&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

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

tripleCC commented 4 years ago

是自己创建的示例工程么? https://github.com/for-example-test/cocoapods_bin_issue_11_import_PodA.git 试下这个工程?

或者执行下以下命令看看:

 pod gen --gen-directory='./build' --sources=你的源码及二进制私有源 --use-libraries --use-modular-headers

看起来是 cocoapods-generate 生成工程时分析依赖出错了, 这个没有实际工程还真不好看问题出在哪?

zhangjianbin commented 4 years ago

你提供的示例工程是正常的。 在我自己有错误的那个组件下执行pod gen --gen-directory='./build' --sources=你的源码及二进制私有源 --use-libraries --use-modular-headers可生成完整的工程,但是编译报错——Declaration of 'MHViewController' must be imported from module 'MiHomeKit.MHBaseBluetoothPreConnectViewController' before it is required。但是我本地编译是成功的。

日志如下: Generating Aircon in build/Aircon .......source........ .......source........ .......source........ Open build/Aircon/Aircon.xcworkspace to work on Aircon

[!] 'AMap2DMap' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

[!] 'AMapFoundation' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

[!] 'AMapLocation' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

[!] 'AMapSearch' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

tripleCC commented 4 years ago

你提供的示例工程是正常的。 在我自己有错误的那个组件下执行pod gen --gen-directory='./build' --sources=你的源码及二进制私有源 --use-libraries --use-modular-headers可生成完整的工程,但是编译报错——Declaration of 'MHViewController' must be imported from module 'MiHomeKit.MHBaseBluetoothPreConnectViewController' before it is required。但是我本地编译是成功的。

日志如下: Generating Aircon in build/Aircon .......source........ .......source........ .......source........ Open build/Aircon/Aircon.xcworkspace to work on Aircon

[!] 'AMap2DMap' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

[!] 'AMapFoundation' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

[!] 'AMapLocation' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

[!] 'AMapSearch' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.

你加我微信聊吧,账户同名

tripleCC commented 4 years ago

https://github.com/tripleCC/cocoapods-bin/commit/42fd391f8c0f4a23e1371b632280addf21e0b3f4 已修复