美文网首页
使用cocoapods-imy-bin插件过程遇到的问题记录

使用cocoapods-imy-bin插件过程遇到的问题记录

作者: malgee | 来源:发表于2021-08-24 19:00 被阅读0次
    问题1:【安装MongoDB报错】mkdir: /data/db: Read-only file system

    创建一个数据库存储目录 /data/db:

    sudo mkdir -p /data/db
    

    然后就报了mkdir: /data/db: Read-only file system这个错误

    报错解决方案:手动创建文件夹 data 和 文件夹db在他们的路径还是 /data/db

    • cddb,执行 sudo mongod --dbpath=/usr/local/data/db启动mongod并设置数据库路径

    另外一种解决方案:【安装MongoDB报错】mkdir: /data/db: Read-only file system

    问题2:执行nmp start报错 npm ERR! missing script: start

    解决方案:进入的路径不对,找不到start命令, 之前这个nmp start命令前提要在binary-sever路径下

    问题3:

    执行 nmp start报错

    npm start
    
    > binary-server@0.1.0 start
    > node app.js
    
    (node:2330) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    (node:2330) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
    /Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/topologies/server.js:438
              new MongoNetworkError(
              ^
    
    MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
        at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1137:16) {
      name: 'MongoNetworkError'
    }]
        at Pool.<anonymous> (/Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/topologies/server.js:438:11)
        at Pool.emit (node:events:378:20)
        at /Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/connection/pool.js:562:14
        at /Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/connection/pool.js:995:11
        at /Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/connection/connect.js:32:7
        at callback (/Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/connection/connect.js:280:5)
        at Socket.<anonymous> (/Users/maling/Desktop/MGSpecs/binary-sever/node_modules/mongodb/lib/core/connection/connect.js:310:7)
        at Object.onceWrapper (node:events:485:26)
        at Socket.emit (node:events:378:20)
        at emitErrorNT (node:internal/streams/destroy:188:8)
        at emitErrorCloseNT (node:internal/streams/destroy:153:3)
        at processTicksAndRejections (node:internal/process/task_queues:81:21)
    npm ERR! code 1
    npm ERR! path /Users/maling/Desktop/MGSpecs/binary-sever
    npm ERR! command failed
    npm ERR! command sh -c node app.js
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/maling/.npm/_logs/2021-08-23T07_06_42_476Z-debug.log
    
    • 启动mongod 指定数据库路径
    sudo mongod --dbpath=~/data/db
    
    问题4: fatal: unable to access 'https://github.com/xxx': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
    • 重启电脑就好了, 解决方案来着这里

    • 另外一种解决方案:

    git config --global --add remote.origin.proxy ""
    

    看这里

    问题5:执行pod bin auto报了这个错误 TypeError - no implicit conversion of nil into String

    缺少一个 后.podspec 的文件,看代码里有检查,可以创建个空的 xxx.podspec 文件
    解决方案看这里

    问题6: fatal: unable to access 'https://github.com/Maling1255/lib_binary_spec.git/': Error in the HTTP2 framing layer

    解决方案执行下面语句:

    git config --global --unset http.proxy 
    git config --global --unset https.proxy
    
    问题7 制作出来的是.framework, 怎么才能生成.a header data

    制作二进制组件的时候删除掉 use_frameworks!这句, 如果需要生成.framework, 可以使用 use_frameworks! :linkage => :static生成静态的二进制库

    问题8

    报错信息

    Validating spec
     -> AFNetworking (4.0.1)
        - WARN  | [iOS] vendored_libraries: `*.a` does not match the expected static library name format `lib[name].a`
    
    The repo `binary_spec` at `../../../../.cocoapods/repos/binary_spec` is not clean
    

    删除二进制私有源,重新添加二进制私有源pod repo add binary_spec https://github.com/xxx/binary_spec_libs.git, 接着执行pod bin auto --all-make就可以了

    问题9 消除警告
    [!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via `pod repo remove master`. To suppress this warning please add `warn_for_unused_master_specs_repo => false` to your Podfile.
    

    根据上面提示:执行pod repo remove master 但是我没有master源,这个解决方案不行,
    在Podfile里面设置 install! 'cocoapods', :warn_for_unused_master_specs_repo => false 也不行。

    我的解决方案是: 查看了pod repo list 发现里面有一个cocoapods源, 移除这个就可以了

    • pod repo remove cocoapods
      这样就消除警告了

    解决方案来之这里

    问题10 The repo binary_spec at ../../../../.cocoapods/repos/binary_spec is not clean

    解决:cd ~/.cocoapods/repos/binary_spec

    $ git clean -f
    

    如果上面的并没有解决问题可以试试下面的终极解决办法

    终极解决办法

    • 先移除
    pod repo remove binary_spec
    
    • 再次添加一次
     pod repo add binary_spec "https://github.com/xxxx/binary_spec_libs.git"
    
    问题10 [!] 【MJExtension | 3.3.0】组件spec push失败 .

    前提,xxx-build-temp文件夹下.a文件和zip文件都正常合成了,本地服务文件上传成功,但是最后结果还是:组件spec push失败。

    s.source = { :git => 'git@gitee.com:xxx/xxmode.git', :tag => s.version.to_s }
    

    这个source换成了ssh格式的就好了

    问题11 报错 curl: (22) The requested URL returned error: 404 Not Found
    Installing...
    Installing AFNetworking (4.0.0)
    Installing AliyunOSSiOS (2.8.0)
    Installing CCLivePlaySDK (3.7.0)
    Installing FDFullscreenPopGesture (1.1)
    
    [!] Error installing AFNetworking
    
    [!] Error installing FDFullscreenPopGesture
    
    [!] Error installing AliyunOSSiOS
    [!] /usr/bin/curl -f -L -o /var/folders/m4/jw6lg3ps0zj1rr5mflxhwhn40000gn/T/d20210907-50002-11mhy5r/file.zip http://localhost:8080/frameworks/AliyunOSSiOS/2.8.0/zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.0 cocoapods-downloader/1.4.0'
    
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (22) The requested URL returned error: 404 Not Found
    
    • 移除旧的二进制repo源, 重新添加解决了(pod repo add xxx https://xxxx
    问题 *

    I 》 启动mongo的,最好设置好数据库路径, eg: sudo mongod --dbpath=/Users/XXXX/data/db

    II 》 node服务启动要在binary-server目录下进行,eg: /cocoapods-imy-bin-demo/binary-server中 执行 npm start 或者 npm run start

    相关文章

      网友评论

          本文标题:使用cocoapods-imy-bin插件过程遇到的问题记录

          本文链接:https://www.haomeiwen.com/subject/baxjiltx.html