NativeScript / NativeScript/nativescript-cli
References of removed dependencies are not deleted from Podfile
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 1.1k
- 派生
- 204
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 8
描述
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 6.2.0
- Cross-platform modules: 6.2.0
- Android Runtime: 6.2.0
- iOS Runtime:
- Plugin(s):
Describe the bug
When a dependency is uninstalled, its reference is not deleted from Podfile in platforms and that leads to the error when trying to run the application on device.
To Reproduce
tns create myApp --jstns prepare iosnpm i tns-core-modules@6.1.0tns prepare ios- You will see the following log in the output:
[!] CocoaPods could not find compatible versions for pod "MaterialComponents/Tabs":
In snapshot (Podfile.lock):
MaterialComponents/Tabs (= 92.4.0, ~> 92.3)
In Podfile:
MaterialComponents/Tabs (~> 84.4)
MaterialComponents/Tabs (~> 92.3)
None of your spec sources contain a spec satisfying the dependencies: `MaterialComponents/Tabs (~> 92.3), MaterialComponents/Tabs (~> 84.4), MaterialComponents/Tabs (= 92.4.0, ~> 92.3)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
[!] There are duplicate dependencies on `MaterialComponents/Tabs` in `Podfile`:
- MaterialComponents/Tabs (~> 92.3)
- MaterialComponents/Tabs (~> 84.4)
and the content of Podfile is the following:
use_frameworks!
target "newPodfileIssue" do
# NativeScriptPlatformSection /Users/myuser/Work/nativescript-cli/scratch/newPodfileIssue/node_modules/@nativescript/core/platforms/ios/Podfile with 9.0
platform :ios, '9.0'
# End NativeScriptPlatformSection
# Begin Podfile - /Users/myuser/Work/nativescript-cli/scratch/newPodfileIssue/node_modules/@nativescript/core/platforms/ios/Podfile
# platform :ios, '9.0'
use_frameworks!
pod 'MaterialComponents/Tabs', '~> 92.3'
# End Podfile
# Begin Podfile - /Users/myuser/Work/nativescript-cli/scratch/newPodfileIssue/node_modules/tns-core-modules/platforms/ios/Podfile
# platform :ios, '9.0'
use_frameworks!
pod 'MaterialComponents/Tabs', '~> 84.4'
# End Podfile
Expected behavior
It should work and the reference to /Users/myuser/Work/nativescript-cli/scratch/newPodfileIssue/node_modules/@nativescript/core/platforms/ios/Podfile should be deleted from Podfile.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 tns prepare ios 使用的 Podfile 生成和清理流程开始,重点关注 platforms 下生成的 Podfile。复现 issue 中的卸载和版本更改步骤,然后验证已移除的 node_modules 依赖项的引用不存在,并且准备过程不再报告重复或不兼容的 pod。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ios, javascript
- 领域
- cli, mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100