Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: can't install capacitor/ios from local repo #2097

Closed
1 of 4 tasks
josh-m-sharpe opened this issue Oct 24, 2019 · 10 comments
Closed
1 of 4 tasks

bug: can't install capacitor/ios from local repo #2097

josh-m-sharpe opened this issue Oct 24, 2019 · 10 comments

Comments

@josh-m-sharpe
Copy link
Contributor

josh-m-sharpe commented Oct 24, 2019

Bug Report

Capacitor Version

  • master
  • tags/1.2.1

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

These all work:

yarn add ../../capacitor/android
yarn add ../../capacitor/core
yarn add -D ../../capacitor/cli

This does not:
yarn add ../../capacitor/ios

Sample Code or Sample Application Repo

 $ yarn add ../../capacitor/android
yarn add v1.19.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @capacitor/[email protected]
info All dependencies
└─ @capacitor/[email protected]
✨  Done in 15.16s.
 
 $ yarn add ../../capacitor/core
yarn add v1.19.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Saved 1 new dependency.
info Direct dependencies
└─ @capacitor/[email protected]
info All dependencies
└─ @capacitor/[email protected]
✨  Done in 8.86s.

 $ yarn add -D ../../capacitor/cli
yarn add v1.19.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @capacitor/[email protected]
info All dependencies
└─ @capacitor/[email protected]
   Done in 9.41s.


 $ yarn add ../../capacitor/ios
yarn add v1.19.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error /Users/jsharpe/[email protected]: Name contains illegal characters
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Other Technical Details

npm --version output:
6.9.0
node --version output:
v10.16.3
pod --version output (iOS issues only):
1.8.4

@priyankpat
Copy link
Contributor

priyankpat commented Oct 24, 2019

https://github.com/ionic-team/capacitor/tree/master/example Did you follow these steps?

@josh-m-sharpe
Copy link
Contributor Author

josh-m-sharpe commented Oct 24, 2019

I saw that. I don't want to test capacitor in the confines of an example app. I want to test it in my app. Actually, I noticed this issue while trying to install capacitor/core, capacitor/cli and capacitor/android in order to test your PR: #2045

@bibyzan
Copy link
Contributor

bibyzan commented Oct 25, 2019

Did you try changing your podfile in ios/App/Podfile to point to your local fork?

pod 'Capacitor', :path => '../forked-repos/capacitor'
pod 'CapacitorCordova', :path => '../forked-repos/capacitor'

Then run pod update in the ios/App directory

@priyankpat
Copy link
Contributor

This is somewhat janky but you can also just set a postinstall hook to copy ios files over.

"postinstall": "npm run ios:copy && ...",
"ios:copy": "cp -r ../capacitor/ios ./node_modules/@capacitor/ios/ios",

@josh-m-sharpe
Copy link
Contributor Author

josh-m-sharpe commented Oct 26, 2019

Truthfully, I have no usecase to test @capacitor/ios locally at this moment. I only noticed the issue when trying to install all of the packages locally in order to work with android. cli, core and android all install with yarn add ~/path/to/capacitor/XYZ. As ios was an exception to that I opened this issue thinking it might be a quick fix and/or I was doing something wrong.

That said, I also cannot build a an android app even after installing capacitor/android locally.

I think all of this is general shortcomings of this document:
https://github.com/ionic-team/capacitor/blob/master/.github/CONTRIBUTING.md

Are there steps that outline how to develop on the platforms using local versions of capacitor?

@bibyzan
Copy link
Contributor

bibyzan commented Oct 31, 2019

That document links to this one https://github.com/ionic-team/capacitor/blob/master/example/README.md which explains installing the pods on the IonicRunner project. I was able to pretty easily take the instructions on the example app and apply it to my own project with prior cocoa pods experience, but perhaps it could be made more clear how to use it on your own. Also the link to this document from the CONTRIBUTING.MD needs to be way more apparent I would think because I passed it the first time I read through it.

@jcesarmobile
Copy link
Member

This is because ios folder is not a proper package. It's like that because CocoaPods doesn't allow pods in folders, they need to be on the root to the github repository (notice that Capacitor.podspec and CapacitorCordova.podspec are both in the root of this repository).
That conflicts with ios folder being a proper npm package.

So, what we do is, as part of the publish process, ./scripts/generate.sh is run and it creates a new capacitor-ios folder with a proper npm package and that's what publish.

So as workaround you can run that script and then install with yarn add ../../capacitor/capacitor-ios. But it's not something we can fix. Will close as won't fix.

@josh-m-sharpe
Copy link
Contributor Author

Probably worth spelling those steps out in the README so others can help out in the future.

@jcesarmobile
Copy link
Member

ios folder is a proper package now and can be installed from local repo, so removing the won't fix label

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants