transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
656 stars 277 forks source link

Plugin Installation fails with cordova-ios 7.0.0 #1407

Closed erkenberg closed 9 months ago

erkenberg commented 10 months ago

Your Environment

Expected Behavior

cordova prepare ios successfully prepares the build and inlcudes the plugin without error

Actual Behavior

cordova prepare ios results in an error:

Error during processing of action! Attempting to revert...
Failed to install 'cordova-background-geolocation-lt': Error [ERR_UNHANDLED_ERROR]: Uh oh!
Unhandled error. ('"framework" tag with type "podspec" is no longer supported. Please use the "podspec" tag.')
    at new NodeError (node:internal/errors:371:5)
    at CordovaEventEmitter.emit (node:events:379:17)
    at CordovaEventEmitter.emit (.../node_modules/cordova-common/src/events.js:69:22)
    at install (.../node_modules/cordova-ios/lib/plugman/pluginHandlers.js:100:32)
    at ActionStack.process (.../node_modules/cordova-common/src/ActionStack.js:55:25)
    at PluginManager.doOperation (.../node_modules/cordova-common/src/PluginManager.js:111:24)
    at PluginManager.addPlugin (.../node_modules/cordova-common/src/PluginManager.js:141:21)
    at Api.addPlugin (.../node_modules/cordova-ios/lib/Api.js:258:14)
    at handleInstall (.../node_modules/cordova-lib/src/plugman/install.js:561:10)
    at .../node_modules/cordova-lib/src/plugman/install.js:344:28
Failed to restore platform "ios". You might need to try adding it again. Error: Error [ERR_UNHANDLED_ERROR]: Uh oh!
Unhandled error. ('"framework" tag with type "podspec" is no longer supported. Please use the "podspec" tag.')
Uh oh!
Unhandled error. ('"framework" tag with type "podspec" is no longer supported. Please use the "podspec" tag.')

Steps to Reproduce

  1. Create a cordova Project using cordova-ios 7.0.0
  2. Add the plugin
  3. Run cordova prepare ios

Context

cordova-ios 7.0.0 was released a few days ago and we wanted to update to it. The relevant breaking change seems to be :

GH-1340 chore!: Remove podspec support from framework tag

From what I see, the issue is likely in the plugin.xml, where <framework type="podspec"> is no longer supported.

christocracy commented 9 months ago

Fixed and released to 4.13.0

erkenberg commented 9 months ago

Awesome, that was so fast I didn't even see it yesterday. Very cool!

I tested it and Installing (And building) works fine now, but I noticed one point that could be improved:

Using https://github.com/CocoaPods/Specs.git as source seems to clones the complete CocoaPods spec repo (around 3.8 GB) which takes quite some time and 99% of the stuff is usually not needed.

According to https://blog.cocoapods.org/CocoaPods-1.8.0-beta/ CocoaPods 1.8 added a new way to prevent this:

With 1.8, CocoaPods no longer requires cloning the now huge master specs repo in order to function and users may integrate their projects with CocoaPods almost instantly.

This works by simply using the CDN url instead: https://cdn.cocoapods.org/, which I also saw from another cordova plugin we use.

I tested it locally by replacing the URL from the 4.13.0 release with the CDN URL and voilá, it no longer clones the complete spec repo but uses the pods already existing on my machine from earlier builds (or would only download the required parts for this plugins if not already downloaded).

I think this would be a nice improvement.

Currently cloning the complete CocoaPods spec repo is:

christocracy commented 9 months ago

Thanks. it will be done in v4.13.1.

It goes like this?

<podspec>
            <config>
                <source url="https://cdn.cocoapods.org/"/>  // <----------------------
            </config>
            .
            .
            .
</podspec>
erkenberg commented 9 months ago

Thanks again fort the quick response, yes, this is exactly how i tested it locally 👍

christocracy commented 9 months ago

v4.13.1 is released. Thanks.

erkenberg commented 9 months ago

Thank you very much, works perfectly 👍