Cordova Slack Digest

Thu, 10 Sep 2020 08:23:36 GMT

User count: 4114

Join the conversation at slack.cordova.io

Channel #general (44 messages)


Wed, 09 Sep 2020 09:34:42 GMT

@ankit17737 says

Hi I am facing a issue with cordova-phonegap. It doesn't support the webGL on IOS.

Wed, 09 Sep 2020 09:35:47 GMT

@ankit17737 says

I have posted a question on Stackoverflow as well

https://stackoverflow.com/questions/63787352/webassembly-not-supported-on-your-browser-ios

Can someone help me with that? I tried using WKWebView as some forums suggested that but when I do so entire application stops working.

Wed, 09 Sep 2020 12:21:30 GMT

@khatridevk says

I am seeing white screen while using inappbrowser, it comes when I load the inappbrowser second time [ close and show ] Observations: 'loadstop' event doesn't get called on second load, on second load I see this error NSURLErrorDomain Code=-999 cancelled in didFailProvisionalNavigation method of CDVWKInAppBeowser.m

my setup: cordova-ios@5.1.1 cordova-plugin-inappbrowser@4.0.0 wkwebview-engine

Any experience on this !!

Wed, 09 Sep 2020 16:06:07 GMT

@yuanzuo says

unable to add cordova-android 9.0.0 cordova version: > cordova -v > 9.0.0 (cordova-lib@9.0.1) Error: > cordova platform add android@9.0.0 > Using cordova-fetch for cordova-android@9.0.0 > Adding android project... > Unable to load PlatformApi from platform. SyntaxError: Unexpected token { > Unhandled “error” event. (The platform “android” does not appear to be a valid cordova platform. It is missing API.js. android not supported.) Thanks for any hints!

Wed, 09 Sep 2020 16:08:17 GMT

@yuanzuo says

Wed, 09 Sep 2020 16:17:46 GMT

@norman137 says

Use the latest version of node 10 (or better, latest version of node 12)

Wed, 09 Sep 2020 16:21:29 GMT

@jcesarmobile says

Do you have an android folder? If so, remove it

Wed, 09 Sep 2020 16:25:12 GMT

@yuanzuo says

what is the syntax to use version of node 10 or node 12? Thanks!

Wed, 09 Sep 2020 16:25:40 GMT

@norman137 says

You install it... use node -v to check your current installed version.

Wed, 09 Sep 2020 16:28:15 GMT

@norman137 says

Node10 is the minimum supported version, Node12 is recommended: https://nodejs.org/en/

Node14 also should work, but it's technically not supported so your mileage may vary. In production environments, you should use Node12.

Wed, 09 Sep 2020 16:29:44 GMT

@yuanzuo says

node -v v8.11.1 - is this version v8 causing issue when my adding cordova-android v9 ?

Wed, 09 Sep 2020 16:31:39 GMT

@norman137 says

node 8 is not supported in cordova-android@9

Wed, 09 Sep 2020 16:32:09 GMT

@norman137 says

So you need to upgrade to at least node10, but I'd recommend upgrading to Node12.

Wed, 09 Sep 2020 16:35:14 GMT

@yuanzuo says

how about cordova CLI version? Do I need to upgrade to 10 (currently I am on v9)?

Wed, 09 Sep 2020 16:43:04 GMT

@norman137 says

v9 still supports node8 i think, but it's definitely dropped in cordova cli v10

Wed, 09 Sep 2020 16:45:17 GMT

@dpogue says

Node 8 is past end-of-life, which is why it got dropped. Node 10 reaches end-of-life at the end of the year.

Wed, 09 Sep 2020 17:33:49 GMT

@yuanzuo says

my current environment: node v8-cordova CLI v9-cordova android v8. in order to upgrade cordova android v9(to support default targetSDKVersion 29), do I need to upgrade both node v8 to v10/v12 and cordova CLI v9 to v10 or just node v8 to node 10/12? Thanks!

Wed, 09 Sep 2020 17:38:27 GMT

@dpogue says

I would recommend updating everything

Wed, 09 Sep 2020 18:48:25 GMT

@chris551 says

Evening all. I‘m really struggling with just simple require command in my JS. I’ve been reading about the cordova.js file that gets generated when you build the app. I‘ve done that, and I’ve included the cordova.js file in my index.html but its still complaining. I can see in the network tab that this magical JS file has loaded... Is there somewhere I can read about this? I‘m really stuck and I’ve only just started getting going. I'm using cordova 10.0.0 and AndroidStudio 4.0.1

Wed, 09 Sep 2020 19:32:44 GMT

@ucheozoemena says

Hey folks, in theory what would be the effect of modifying cordova.js to mark plugin scripts as async when injecting them? I can expect this to bring DOMContentLoaded forward, but I‘m not certain what effect it would have on when pluginsReady fires, which blocks when deviceready fires. Also, assuming this strategy helps reduce load time, would this be a good idea to try in a production app considering that the cordova team probably has a good reason for not already doing this? I’m considering different things to improve my app‘s load time and I can see in dev tools that the time to parse plugin scripts is one of the bottlenecks. Unfortunately I have plugins that load multiple scripts (38 scripts for one particular plugin) but they are essential to my app’s functionality.

Thu, 10 Sep 2020 07:34:49 GMT

@abul.asar22 says

Hello everyone, what is the step to running iOS build. I am upgrading my cordova-ios from 5.1.0 to 6.0.0. My CI build is failing with error.

Error: No platforms added to this project. Please use `cordova platform add <platform>`.```
Can  anyone guide me for this.

Thu, 10 Sep 2020 07:38:56 GMT

@jordi289 says

Well the project doesnt recognize you having added the platform iOS. Could you check your package.json for the platforms?

Thu, 10 Sep 2020 07:39:09 GMT

@jordi289 says

If iOS isn't there, just run cordova platform add ios

Thu, 10 Sep 2020 07:39:10 GMT

@pratiksha.bhavsar0895 says

check doing cordova platform ls , if ios platform is added ?

Thu, 10 Sep 2020 07:43:22 GMT

@abul.asar22 says

i have specifically added in config.xml as <engine name="ios" spec="6.0.0" /> . Is this not enough ?

Thu, 10 Sep 2020 07:43:42 GMT

@jordi289 says

But is it in your package.json?

Thu, 10 Sep 2020 07:44:09 GMT

@jordi289 says

Cause that‘s the file you should be looking in for defining which platforms you’re developing for

Thu, 10 Sep 2020 07:44:58 GMT

@abul.asar22 says

we don’t commit package.json as a part of our CI pipeline but yes on running locally i can see

    "cordova-ios": "6.0.0",
    "cordova-android": "9.0.0",
    "cordova-windows": "~4.3.1"
  },```
also
```"cordova": {
    "platforms": [
      "ios",
      "android",
      "windows"
    ],```

Thu, 10 Sep 2020 07:45:51 GMT

@erisu says

you should commit your package.json, not sure why you wouldn’t.

Thu, 10 Sep 2020 07:46:07 GMT

@jordi289 says

I'm on Erisu with this one

Thu, 10 Sep 2020 07:47:30 GMT

@jordi289 says

But my first instinct would be removing and re-adding the iOS platform, but that would make you lose local changes to your xcode project.

Thu, 10 Sep 2020 07:47:30 GMT

@erisu says

We use to define plugins and platforms in config.xml . That was the old way. It is still possible I believe to use the old method, but we been migrating away to use the values from package.json and only fall back to config.xml if missing.

Thu, 10 Sep 2020 07:49:11 GMT

@abul.asar22 says

Sure.. i’ll commit that one. Where as the steps to build the project can anyone show me steps to build the project ?

Thu, 10 Sep 2020 07:50:18 GMT

@erisu says

To build you just run cordova build <platform> so for example if you want to build only iOS cordova build ios , but you need to run this on a macOS.

Thu, 10 Sep 2020 07:52:05 GMT

@erisu says

Here is the <https://cordova.apache.org/docs/en/latest/guide/cli/index.html|Create your first Cordova App> guide which include the build step as well.

Thu, 10 Sep 2020 07:52:09 GMT

@abul.asar22 says

when is cordova platform add ios is done ?

Thu, 10 Sep 2020 07:57:10 GMT

@erisu says

You only need to run that when you add the platform to your project for the first time..

So for example if you created a new Cordova app with cordova create and you wanted this app to have iOS, then you run that command. That command will then add the platform information to package.json and check out for you locally..

From a CI standpoint, when it clones the repo which should have package.json commit as well, you could run cordova prepare and then cordova build ios … The prepare step for the first time in a clean instance will checkout everything that is defined in package.json which includes the platform.

Thu, 10 Sep 2020 07:58:32 GMT

@abul.asar22 says

yeah. i’ve committed package.json now. And yes we have desc "Cordova prepare {platform}" and desc "Cordova build {platform}" these two steps in line.

Thu, 10 Sep 2020 07:59:08 GMT

@erisu says

that should work

Thu, 10 Sep 2020 08:00:29 GMT

@erisu says

Also, Cordova-iOS 6.1.1 is the latest and recommend… There was a small bug in 6.0.0 which was fixed in 6.1.0…

Thu, 10 Sep 2020 08:17:54 GMT

@abul.asar22 says

Still same error after committing package.json.

Thu, 10 Sep 2020 08:19:03 GMT

@abul.asar22 says

It seems my config.xml has started executing. But as soon as it reaches to &lt;engine name="ios" spec="6.0.0" /&gt; it fails.

Using cordova-fetch for cordova-ios@6.0.0
Adding ios project...
Unable to load PlatformApi from platform. SyntaxError: Unexpected token ...
Error: Uncaught, unspecified "error" event. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
Error: No platforms added to this project. Please use `cordova platform add &lt;platform&gt;`.```

Thu, 10 Sep 2020 08:21:11 GMT

@jordi289 says

And you are 100% sure you've used the command: cordova platform add ios ?

Thu, 10 Sep 2020 08:21:47 GMT

@jordi289 says

And there is a folder within the platforms folder that is names ios ?

Channel #plugins (34 messages)


Wed, 09 Sep 2020 18:34:34 GMT

@joel says

Has anyone dealt with issues publishing scoped public packages to the npm registry? I keep getting an error, “You must sign up for private packages” when running the command, “npm publish --access public”. I just don't understand why npm seems to be treating this package as private. All of the support around this error really seems clear that this would be resolved by specifying the “access” flag.

Wed, 09 Sep 2020 18:37:01 GMT

@norman137 says

do you have a private: true in the json config?

Wed, 09 Sep 2020 18:37:06 GMT

@norman137 says

package.json*

Wed, 09 Sep 2020 18:37:52 GMT

@joel says

no

Wed, 09 Sep 2020 18:38:44 GMT

@dpogue says

yeah, --access public should work... maybe try --access=public just for fun?

Wed, 09 Sep 2020 18:39:12 GMT

@joel says

🙂 ... I've been having fun all morning. I did try that format, but same result.

Wed, 09 Sep 2020 18:39:13 GMT

@timbru says

Correct user that’s part of the organization?

Wed, 09 Sep 2020 18:39:45 GMT

@joel says

Yeah, I‘m the only user / owner in the org, I’m logged in ....

Wed, 09 Sep 2020 18:40:23 GMT

@timbru says

Correct registry defined? (check your ~/.npmrc

Wed, 09 Sep 2020 18:40:39 GMT

@norman137 says

or use npm config get registry

Wed, 09 Sep 2020 18:40:54 GMT

@joel says

<https://registry.npmjs.com/>```

Wed, 09 Sep 2020 18:42:10 GMT

@norman137 says

yah im not sure... your environment looks correct based on what you told us

Wed, 09 Sep 2020 18:42:37 GMT

@timbru says

npm docs say you need to do one of the two commands first (depending if it’s a user or org scope)

npm init --scope=@my-username```


Wed, 09 Sep 2020 18:43:04 GMT

@timbru says

but it seems only for the local creation of the folder and file structure etc

Wed, 09 Sep 2020 18:44:24 GMT

@joel says

Thanks. I've tried creating a basic new package from scratch using npm init --scope=@my-org, but it hits the same wall.

Maybe some bad wiring on npm's side. Will wait to hear back from support.

Thanks for trying!

Wed, 09 Sep 2020 18:44:57 GMT

@norman137 says

the package name inside package.json should be "name": "@my-scope/my-package"

Wed, 09 Sep 2020 18:45:51 GMT

@joel says

Yeah, that all matches up.

Wed, 09 Sep 2020 18:53:05 GMT

@joel says

Would anyone have a couple seconds to test this to see if they get same results?

  • Create new throw away org
  • Create new package scoped to org (mkdir great-new-package &amp;&amp; cd great-new-package &amp;&amp; npm init --scope=@throw-away-org)
  • Publish (npm publish --access public)

Wed, 09 Sep 2020 21:38:38 GMT

@joel says

npm ended up fixing something on their side for all publicly scoped packages. Thanks for all the ideas!

Wed, 09 Sep 2020 22:06:40 GMT

@norman137 says

👍

Thu, 10 Sep 2020 00:29:03 GMT

@joel says

Although after all that, does Cordova support installing plugins from scoped public packages .... 🤦

Thu, 10 Sep 2020 00:29:57 GMT

@dpogue says

The latest versions should

Thu, 10 Sep 2020 00:32:45 GMT

@joel says

By latest do you mean 10.x? I‘m seeing it in the docs for 9.x, which is what I’m using, or trying to.

Thu, 10 Sep 2020 00:33:33 GMT

@dpogue says

For sure 10.x, but I think probably also 9.x... I haven't tried it myself

Thu, 10 Sep 2020 00:33:48 GMT

@joel says

Do you know if the plugin id reflects the scope?

Thu, 10 Sep 2020 00:33:58 GMT

@joel says

Like, in plugin.xml?

Thu, 10 Sep 2020 00:34:41 GMT

@joel says

There's two references in package.json and one in plugin.xml. Not clear on the perfect recipe.

Thu, 10 Sep 2020 00:37:22 GMT

@joel says

&lt;plugin xmlns="<http://apache.org/cordova/ns/plugins/1.0>"
    xmlns:android="<http://schemas.android.com/apk/res/android>"
    id="@scope/my-plugin-id"
    version="1.0.2"&gt;```
Is that the right way?

Thu, 10 Sep 2020 00:41:42 GMT

@dpogue says

That would be my guess

Thu, 10 Sep 2020 01:18:08 GMT

@joel says

Doesn't seem to like it.

Thu, 10 Sep 2020 01:18:21 GMT

@joel says

Probably this is either a connection problem, or plugin spec is incorrect.```

Thu, 10 Sep 2020 03:51:31 GMT

@norman137 says

We have one plugin that is scoped, but we don't use the scope schema for the plugin id:

https://github.com/totalpave/cordova-plugin-date/blob/master/plugin.xml

Thu, 10 Sep 2020 03:55:01 GMT

@norman137 says

We do use the scope schema in package.json however.

I'm not sure if this creates any other issues however...

Thu, 10 Sep 2020 08:15:42 GMT

@timbru says

We are using the same setup as Norman, but I think @raphinesse did a PR last year that added proper scoped support.