NativeScript / NativeScript/nativescript-cli

References of removed dependencies are not deleted from Podfile

Aperta
#5,153 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug os: ios
Lingua principale
JavaScript
Stelle
1.1k
Fork
204
Merge medio
1g 9h
PR unite (30g)
8

Descrizione

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

  1. tns create myApp --js
  2. tns prepare ios
  3. npm i tns-core-modules@6.1.0
  4. tns prepare ios
  5. 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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il flusso di generazione e pulizia del Podfile utilizzato da tns prepare ios, concentrandoti sul Podfile generato in platforms. Riproduci i passaggi di disinstallazione e modifica della versione riportati nell’issue, quindi verifica che siano assenti i riferimenti alle dipendenze node_modules rimosse e che la preparazione non segnali più pod duplicati o incompatibili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, javascript
Ambito
cli, mobile
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.