nordnet/cordova-hot-code-push

Build configuration for "dev" not found in chcp.options. Ignoring it.

Closed this issue · 6 comments

when i create chcpbuild.options file inside /Cordova/Testproject/ and put in it the following content:

{
  "dev": {
    "config-file": "https://dev.company_server.com/mobile/www/chcp.json"
  },
  "production": {
    "config-file": "https://company_server.com/mobile/www/chcp.json"
  },
  "QA": {
    "config-file": "https://test.company_server.com/mobile/www/chcp.json"
  }
}

please help,many thanks

Just used your config and it worked...

  1. Can you give me some step-by-step on how to reproduce it?
  2. What node version you are using?
  3. What cordova CLI version you are using?
  4. What version of the plugin you are using?

What I did is:

cordova create Test
cd ./Test
cordova platform add ios
touch chcpbuild.options

Then added your config and executed:

cordova prepare ios -- chcp-dev

As a result I got:

Using config from chcp.options:
{
  "config-file": {
    "url": "https://dev.company_server.com/mobile/www/chcp.json"
  }
}
Resulting config will contain the following preferences:
{
  "config-file": {
    "url": "https://dev.company_server.com/mobile/www/chcp.json"
  }
}

thank you for answering

nodejs  v4.4.3
ionic 1.7.16
cordova 6.2.0
cordova-hot-code-push 1.5.2
my project is ionic 
ionic start myApp 
cd myApp
cordova add plugin cordova-hot-code-push

create chcpbuild.options file inside myApp/ and put in it the following content:
{ "dev": { "config-file": "https://dev.company_server.com/mobile/www/chcp.json" }, "production": { "config-file": "https://company_server.com/mobile/www/chcp.json" }, "QA": { "config-file": "https://test.company_server.com/mobile/www/chcp.json" } }
my config.xml is
<chcp> <native-interface version="1"/> <config-file url="http://10.10.3.14:8081/bdk/upload/www/chcp.json"/> </chcp>
the file name is chcp.options or chcpbuild.options?
when run ionic build android -- chcp -dev
Running command: "D:\Program Files\nodejs\node.exe" D:\03-bak\baiduoke\hooks\after_prepare\010_add_platform_class.js D:\03-bak\baiduoke add to body class: platform-android Running command: "D:\Program Files\nodejs\node.exe" D:\03-bak\baiduoke\hooks\after_prepare\020_remove_sass_from_platforms.js D:\03-bak\baiduoke CHCP plugin after prepare hook: Build configuration for "dev" not found in chcp.options. Ignoring it. config-file set to http://10.10.3.14:8081/bdk/upload/www/chcp.json ANDROID_HOME=D:\Android\sdk JAVA_HOME=D:\Program Files\Java\jdk1.8.0_91

Tried your setup and it worked fine... Maybe it's because you are using Windows, which I don't have right now...

Can you try to debug it on your side? Open plugins/cordova-hot-code-push-plugin/scripts/afterPrepareHook.js, go to line 89 and check, what is happening in this function. It is responsible for processing console arguments.

If you still need help debugging, try putting some console logs in plugins/cordova-hot-code-push-plugin/scrips/lib/chcpBuildOptions.js.

You can check it has the correct filepath in the function getBuildOptionsFromConfig, and you check that it's reading the right file by logging the data variable of the function "readObjectFromFile".

I ultimately had the problem that my JSON was invalid, so JSON.parse(data, 'utf-8') returned null

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #371 for more information.