pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Allow setting cordova path (package name) #332

Open hughjdavey opened 5 years ago

hughjdavey commented 5 years ago

When I run pwabuilder https://int.example.com -p android I get the error App id contains a reserved word, or is not a valid identifier. from the cordova create command. It appears that PWABuilder is using the reverse domain name of my site to generate the path, but cordova doesn't like it as int is a reserved word in Java.

From looking at the Cordova Create docs it seems Cordova doesn't care what this path as (as long as the directory doesn't exist), so I was wondering if there was (or could be created) an option to specify a packageName/path on the command line to avoid this issue?

Thanks for your time

P.S. Relevant logs captured with debug logging mode:

[info ] pwabuilder  : Scanning https://int.example.com for manifest...
[info ] pwabuilder  : Found a w3c manifest...
[debug] pwabuilder  : Manifest contents:
...
[debug] pwabuilder  : Loading platform module: pwabuilder-cordova
[debug] pwabuilder  : Creating the 'Cordova Platform' app...
[info ] cordova     : Generating the Android Platform app(s)...
[info ] cordova     : Creating the Cordova Platform project...
[debug] pid:28037   : Launching external process: '/tmp/pwatest/node_modules/.bin/cordova create cordova com.example.int MyApp'
[debug] pid:28037   : 
[debug] pid:28037   : You have been opted out of telemetry. To change this, run: cordova telemetry on.
[debug] pid:28037   : App id contains a reserved word, or is not a valid identifier.
...
hughjdavey commented 5 years ago

Happy to provide a pull request if desired (think the actual issue is in pwabuilder-lib but raised here as it seems to be the main repo)

lucaasrojas commented 5 years ago

@hughjdavey I assume that https://int.example.com isn't the site that you used. Can you update the description with the right site?