Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

pwabuilder fails when domain name fragment starts with a number (e.g. beta.3r.org.uk) #300

Open
Dan-Q opened this issue Apr 9, 2018 · 3 comments
Assignees
Labels

Comments

@Dan-Q
Copy link

Dan-Q commented Apr 9, 2018

I've a working pwabuilder installation which functions for other projects, but running the following fails:

pwabuilder https://beta.3r.org.uk/ -s "Beta3R" -l debug -p android

From the trace below, you'll note that the "Package" name has been set to "uk.org.r.beta" when it should have been set to "uk.org.3r.beta"; I suspect that some overenthusiastic correction is going on somewhere, but I'm not familiar enough with the codebase to understand where to start looking for the problem.

Relevant part of output:

[debug] pid:11596   : Creating Cordova project for the Android platform:
[debug] pid:11596   :   Path: platforms/android
[debug] pid:11596   :   Package: uk.org.r.beta
[debug] pid:11596   :   Name: Beta3R
[debug] pid:11596   :   Activity: MainActivity
[debug] pid:11596   :   Android target: android-23
[debug] pid:11596   : Android project created with [email protected]
[debug] pid:11596   : Installing "cordova-plugin-hostedwebapp" for android
[debug] pid:11596   : Installing "cordova-plugin-whitelist" for android
[debug] pid:11596   :
[debug] pid:11596   :                This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
[debug] pid:11596   :
[debug] pid:11596   : Fetching plugin "cordova-plugin-network-information" via npm
[debug] pid:11596   : Installing "cordova-plugin-network-information" for android
[debug] pid:11596   : Plugin "cordova-plugin-whitelist" already installed on android. Making it top-level.
[debug] pid:11596   : Updating Cordova configuration from W3C manifest...
[debug] pid:11596   : Error: Cannot read property 'toLowerCase' of undefined
[error] pwabuilder  : Failed to create the Cordova Platform app.
      at node_modules/pwabuilder/node_modules/pwabuilder-lib/lib/projectBuilder.js:147:31
      at _rejected (node_modules/pwabuilder/node_modules/q/q.js:864:24)
      at node_modules/pwabuilder/node_modules/q/q.js:890:30
      at Promise.when (node_modules/pwabuilder/node_modules/q/q.js:1142:31)
      at Promise.promise.promiseDispatch (node_modules/pwabuilder/node_modules/q/q.js:808:41)
      at node_modules/pwabuilder/node_modules/q/q.js:624:44
      at runSingle (node_modules/pwabuilder/node_modules/q/q.js:137:13)
      at flush (node_modules/pwabuilder/node_modules/q/q.js:125:13)
      at _combinedTickCallback (internal/process/next_tick.js:131:7)
      at process._tickCallback (internal/process/next_tick.js:180:9)
  Failed to add the Cordova platforms: android.
      at node_modules/pwabuilder/node_modules/pwabuilder-cordova/lib/platform.js:76:23
      at _rejected (node_modules/pwabuilder/node_modules/q/q.js:864:24)
      at node_modules/pwabuilder/node_modules/q/q.js:890:30
      at Promise.when (node_modules/pwabuilder/node_modules/q/q.js:1142:31)
      at Promise.promise.promiseDispatch (node_modules/pwabuilder/node_modules/q/q.js:808:41)
      at node_modules/pwabuilder/node_modules/q/q.js:624:44
      at runSingle (node_modules/pwabuilder/node_modules/q/q.js:137:13)
      at flush (node_modules/pwabuilder/node_modules/q/q.js:125:13)
      at _combinedTickCallback (internal/process/next_tick.js:131:7)
      at process._tickCallback (internal/process/next_tick.js:180:9)
  External process [process ID: 11596] completed with errors. Error: Cannot read property 'toLowerCase' of undefined
      at ChildProcess.<anonymous> (node_modules/pwabuilder/node_modules/pwabuilder-lib/lib/processTools.js:109:17)
      at emitTwo (events.js:126:13)
      at ChildProcess.emit (events.js:214:7)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
@boyofgreen
Copy link
Contributor

yea, I think this is because we are cleansing for the package name. Let me see if someone can look at this. Android only where you see this?

@boyofgreen boyofgreen self-assigned this Apr 11, 2018
@Dan-Q
Copy link
Author

Dan-Q commented Apr 11, 2018

Don't know; I can only promise it fails for Android because I only know for certain that Android works normally on this box. Sorry I'm not much use; this tool's way outside my normal wheelhouse.

@lucaasrojas
Copy link
Contributor

@Dan-Q I reviewed the issue and I found that the problem was with Cordova, which was replaced with a native android implementation. I made a test and the name was set correctly. Could you try it out to confirm?

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants