Edit: "Could not find ROOT_URL in downloaded asset bundle"

I have been investigating this for hours without success:

My app is deployed on Heroku and works well in browsers.

Then I run it on iOS with:

meteor run ios-device --mobile-server https://<url>

It load and after a few seconds, HCP refreshes the pages and the app loses the connection with the server and I’m now connected to a different host (local).

I have tried:
-setting environement variables on the server (ROOT_URL, DDP_DEFAULT_CONNECTION_URL, MOBILE_DDP_URL)
-removing/adding ios platform
-deleting build folders before building

Very similar to: Deploying server for Meteor Cordova App
But this post did not do the trick for me. @martijnwalraven

Any idea on how to debug that?

Thanks a lot

You need to set the environment variable ROOT_URL where you call meteor run from. Set it to the same value as your mobile server.

You do realize that he did just that?

It’s progressing a bit. I have defined ROOT_URL on my local console with

export ROOT_URL=https://…

Now the cordova app starts and stays connected to the server. So this is great.
However, now HCP does not work at all and creates the following error:

Error: Could not find ROOT_URL in downloaded asset bundle

in

http://localhost:12032/plugins/cordova-plugin-meteor-webapp/www/webapp_local_server.js

But ROOT_URL is defined on the server. Any idea?

He says he set it on the server. He also needs to set it where he runs meteor run from. From what I understood of his message, his server is on heroku, but he must be running the ios-device for testing locally.

I’m not sure - I’ve not seen this before - I follow a pretty similar workflow when we want to test our production or staging apps with debugging enabled and it works fine - that being said, your hot code push will only update when you deploy to your remote server - not each time you make a change locally.

Yes I meant HCP does not work when I deploy a change on the server.
The app is downloading the new bundle but says it has not ROOT URL.
So I probably need to declare it better on the website but I have already done it, so I don’t know what to do more?

Nevermind, I have done a fresh install and now it’s working. Thanks.