GithubHelp home page GithubHelp logo

Comments (13)

leshik avatar leshik commented on August 10, 2024

The main issue is that it now targets SDK v11 on iOS, so this should be changed in plugin too. Besides that it works great!

One small suggestion though: is it possible to make this plugin to not write absolute paths to the Podfile somehow? This file should be versioned, and developers obviously have different directory structure on their machines. Capacitor prefixes its plugins' paths with ../.. instead, but could something like this be done here?

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

@leshik I have searched for absolute paths but not found anything.

Are you sure you mean the plugins Podfile? Can you point me to that file?

I have that in my capacitor project ios/App/Podfile when I run npx cap sync the Capacitor cli writes an absolute path to the plugin.

from generic-oauth2.

leshik avatar leshik commented on August 10, 2024

@moberwasserlechner Here are exact steps you can do to reproduce the issue:

npx @capacitor/cli create cap-test-app
cd cap-test-app
npm i @byteowls/capacitor-oauth2
npx cap add ios

Then execute cat ios/App/Podfile, it will look like:

platform :ios, '11.0'
use_frameworks!

target 'App' do
  # Add your Pods here

  # Automatic Capacitor Pod dependencies, do not delete
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
  pod 'ByteowlsCapacitorOauth2', :path => '/Users/leshik/projects/cap-test-app/node_modules/@byteowls/capacitor-oauth2'
  # Do not delete
end

Note that, while Capacitor and CapacitorCordova use relative paths, ByteowlsCapacitorOauth2 uses the absolute one.

PS: my resulting package.json is:

{
  "name": "capacitor-app",
  "version": "1.0.0",
  "description": "An Amazing Capacitor App",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "capacitor",
    "mobile"
  ],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@byteowls/capacitor-oauth2": "^1.0.0-alpha.24",
    "@capacitor/cli": "^1.0.0-beta.11",
    "@capacitor/core": "^1.0.0-beta.11",
    "@capacitor/ios": "^1.0.0-beta.11"
  }
}

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

That's what I meant.

Capacitor CLI writes the dependency in there and also resolves the path to it. I guess this happens for all custom plugins. This is most likely a bug in the CLI or I miss sth.

# Automatic Capacitor Pod dependencies, do not delete
pod 
# Do not delete

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

I'll create a task in the Capacitor repo.

from generic-oauth2.

leshik avatar leshik commented on August 10, 2024

I guess this happens for all custom plugins. This is most likely a bug in the CLI

That's what I suspected too. If you know how to fix it, maybe better to open PR there. They are quick to merge bug fixes.

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

I know where it must happen but not how to fix it. I will point them to it.

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

See ionic-team/capacitor#998

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

Upgrade done for Web and Android with 1.0.0-alpha.25

I tested it on Win10 and ran into ionic-team/capacitor#992 when npx cap sync android had to manually fix it.

Up next IOS with next couple of npm versions ;)

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

Docs for the next upgrade of Capacitor:

Use concrete version of Capacitor in

After changing the dependencies do

  • Clean the cocoapod cache pod cache clean --all
  • Update the cocoapod sudo gem install cocoapods
  • Update the local cocoapod repository with the changes fromt he master pod update
  • If that does not work remove the Podfile.lock and run pod install

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

I have problems getting the right version of the Capacitor in the ios part, which also works when I try to test it in my project. 1.0.0-beta.26 is currently breaking ngx cap sync ios.

I asks the following in Slack

hi,
i'm trying to upgrade my custom plugin to beta.11 and I have problems.

To get the new beta.11 I had to use the concrete version in my podspec s.dependency 'Capacitor', '~> 1.0.0-beta.11' and pod 'Capacitor', '~> 1.0.0-beta.11' in my Podfile.

If I now publish the plugin and try it in my project and run npx cap sync ios I get

✔ Copying native bridge in 25.87ms
✔ Copying capacitor.config.json in 1.77ms
✔ copy in 301.00ms
✔ Updating iOS plugins in 8.11ms
  Found 1 Capacitor plugin for ios:
    ByteowlsCapacitorOauth2 (1.0.0-alpha.26)
✖ Updating iOS native dependencies: 
✖ update ios: 
[error] Error running update: Analyzing dependencies
Fetching podspec for `ByteowlsCapacitorOauth2` from `/Users/moberwasserlechner/development/tc/team-conductor-go/node_modules/@byteowls/capacitor-oauth2`
Fetching podspec for `Capacitor` from `../../node_modules/@capacitor/ios`
Fetching podspec for `CapacitorCordova` from `../../node_modules/@capacitor/ios`
[!] CocoaPods could not find compatible versions for pod "Capacitor":
  In Podfile:
    ByteowlsCapacitorOauth2 (from `/Users/moberwasserlechner/development/tc/team-conductor-go/node_modules/@byteowls/capacitor-oauth2`) was resolved to 1.0.0-alpha.26, which depends on
      Capacitor (~> 1.0.0-beta.11)

    Capacitor (from `../../node_modules/@capacitor/ios`)

Sync finished in 3.291s```

I then reverted the `podspec` and `Podfile` not using concrete versions. Now I don't get the new Capacitor version but an old one `0.0.113` with the GCDWebServer still present.

See my console logs after running `pod update Capacitor` once I changed the dependency back.

```Analyzing dependencies
Downloading dependencies
Installing Capacitor 0.0.113 (was 1.0.0-beta.11 and source changed to `https://github.com/CocoaPods/Specs.git` from `https://github.com/cocoapods/specs.git`)
Installing CapacitorCordova 0.0.113 (was 1.0.0-beta.11 and source changed to `https://github.com/CocoaPods/Specs.git` from `https://github.com/cocoapods/specs.git`)
Installing GCDWebServer (3.4.2)
Using OAuthSwift (1.2.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 4 total pods installed.```
Any ideas?

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

Due to a problem in the Capacitor release script I needed to use beta.10 in the plugin's podspec and Podfile. So as soon as the plugin is used in an App the Capacitor versions match.

Thanks to @jcesarmobile for helping.

The App still uses beta.11.

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

I tested alpha.27 on iOS and it works.

from generic-oauth2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.