NativeScript / NativeScript/nativescript-cli

Invalid `Podfile` file: syntax error, unexpected keyword_end

未关闭
#4,760 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug build CocoaPods
主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

描述

Which platform(s) does your issue occur on?
  • iOS
Please, provide the following version numbers that your issue occurs with:
  • CLI: 5.4.2
  • Cross-platform modules: 5.0.0
  • Runtime(s): tns-ios: 5.4.2
  • Plugins (the demo app created by running npm run postclone):
  "dependencies": {
    "nativescript-theme-core": "~1.0.4",
    "nativescript-twilio-chat": "file:../src",
    "tns-core-modules": "~5.4.0"
  },
  "devDependencies": {
    "nativescript-dev-typescript": "~0.10.0",
    "nativescript-dev-webpack": "~0.24.0"
  },
Please, tell us how to recreate the issue in as much detail as possible.
  • sudo gem install cocoapods (if not already installed)
  • mkdir plugin-test
  • cd plugin-test
  • git clone https://github.com/NativeScript/nativescript-plugin-seed _plugins/nativescript-version-number
  • cd _plugins/nativescript-version-number/src
  • npm run postclone
  • I entered twilio-chat for the plugin name and chose defaults (create a demo TypeScript app)
  • create the following Podfile in _plugins/nativescript-version-number/src/platforms/ios (as per Twilio Programable Chat docs)
source 'https://github.com/CocoaPods/Specs'

target 'MyTarget' do
  pod 'TwilioChatClient', '~> 2.4.2'
end
  • replace MyTarget with demo
  • in 2 terminal windows, both in _plugins/nativescript-version-number/src, run:
  • npm run plugin.tscwatch
  • npm run demo.ios

Result: [!] Invalid 'Podfile' file: syntax error, unexpected keyword_end, expecting end-of-input.
The generated Podfile (_plugins/nativescript-version-number/demo/platforms/ios/Podfile) looks like this:

use_frameworks!

target "demo" do
end

end

# Begin Podfile - /www/plugin-test/_plugins/nativescript-version-number/demo/node_modules/nativescript-twilio-chat/platforms/ios/Podfile
source 'https://github.com/CocoaPods/Specs'

target 'demo' do
  pod 'TwilioChatClient', '~> 2.4.2'
end

# End Podfile
end

Removing the end in my Podfile, I still get the same error (and just one less end in the resulting Podfile).
At one point I even got a Duplicate target "demo" error, so I even tried removing the line target 'demo' do line from my Podfile, but still no luck, still got the [!] Invalid 'Podfile' file: syntax error, unexpected keyword_end, expecting end-of-input. error.
Even if I delete all content from my Podfile, to have it empty, I still get a bad resulting Podfile:

use_frameworks!

target "demo" do
end

end

# Begin Podfile - /www/plugin-testt/_plugins/nativescript-version-number/demo/node_modules/nativescript-twilio-chat/platforms/ios/Podfile

# End Podfile
end

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先在 _plugins/nativescript-version-number/src/platforms/ios/Podfile 中重现该问题,并将其与生成的 demo/platforms/ios/Podfile 进行比较。运行 npm run plugin.tscwatch 和 npm run demo.ios,然后跟踪插件 Podfile 如何与 demo target 组合。生成的 Podfile 具有配对平衡的 target 块,并且 iOS demo 命令在没有语法错误的情况下完成,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
cli, mobile-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。