Giter VIP home page Giter VIP logo

Comments (12)

NexusLee avatar NexusLee commented on June 5, 2024

And I am on windows

from cordova-hot-code-push-cli.

NexusLee avatar NexusLee commented on June 5, 2024

According to nordnet/cordova-hot-code-push-local-dev-addon#5,
I finally got the "a user connected" in the command line, but it still cant refresh automatically in the emulator.

from cordova-hot-code-push-cli.

NexusLee avatar NexusLee commented on June 5, 2024

And my chcp.json is still xxx.ngrok.com

from cordova-hot-code-push-cli.

nikDemyankov avatar nikDemyankov commented on June 5, 2024

As I understand, you have done everything, as described in tutorial.

  1. Make sure, that https://xxx.ngrok.com/chcp.json is accessible from your emulator.
  2. Make sure, that https://xxx.ngrok.com/chcp.manifest is accessible from your emulator.
  3. Make sure, that paths in chcp.manifest are relative to the www folder and doesn't hold \. There might be a problem with that on windows.
  4. Open your project in IDE (probably this is Android - then use Android Studio), and run it from there. Look into console for any messages from the plugin. It should log errors/success events.

from cordova-hot-code-push-cli.

NexusLee avatar NexusLee commented on June 5, 2024

Modify the chcp.json and it will change to ngrok.com at last

from cordova-hot-code-push-cli.

NexusLee avatar NexusLee commented on June 5, 2024

@nikDemyankov ngrok.com is blocked. So I change ngrok.com to my local IP in afterPrepareHook.js. But the chcp.json is still ngrok.com.

from cordova-hot-code-push-cli.

nikDemyankov avatar nikDemyankov commented on June 5, 2024

If ngrok is blocked - you can use some other local server, that will serve your www files, as mentioned in nordnet/cordova-hot-code-push-local-dev-addon#5.

In that case you can still use local development add-on to automatically trigger page reload. Just make sure, that config-file url is set to the correct address in your platform-specific config.xml (probably this is what you do in afterPrepareHook.js). Also, create cordova-hcp.json file in the root folder of your Cordova project, and define there:

{
  "content_url": "http://<YOUR_LOCAL_SERVER_ADDRESS>/"
}

And after each change you do - execute cordova-hcp build to refresh content of the config files in www.

from cordova-hot-code-push-cli.

NexusLee avatar NexusLee commented on June 5, 2024

I am sorry. I read your comment over and over again, but I still don't know clearly what the local server can help? I created cordova-hcp.json and I execute cordova-hcp build after each change in www. And the content_url is my local IP address in chcp.json now. Can u tell me how the local server do to www files. Thanks.

from cordova-hot-code-push-cli.

nikDemyankov avatar nikDemyankov commented on June 5, 2024

Have you checked all, what is described in #45 (comment) ?

You can get update logs from Android Studio. Just launch Android Studio, click Open an existing Android Studio project and select E:\work\cordova\demo\platforms\android. Then from it launch the app on the emulator/device and look into the logs, displayed in the studio. There you should see logs with tag CHCP. If update has failed for some reason - you should see it in there.

from cordova-hot-code-push-cli.

NexusLee avatar NexusLee commented on June 5, 2024

@nikDemyankov About this I didn't use android studio before, but finally I got this error. It's a parse error.

03-03 21:05:27.643 2912-3022/io.cordova.hellocordova D/CHCP﹕ New Release is available
03-03 21:05:27.660 2912-3023/io.cordova.hellocordova D/CHCP﹕ Starting loader worker
03-03 21:05:27.684 2912-3023/io.cordova.hellocordova D/CHCP﹕ Failed to convert json string into application config
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source:

Cordova App Loader

sssssssssssssss

; line: 1, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:508)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:437)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1462)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3105)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:1833)
at com.nordnetab.chcp.main.config.ApplicationConfig.fromJson(ApplicationConfig.java:48)
at com.nordnetab.chcp.main.network.ApplicationConfigDownloader.createInstance(ApplicationConfigDownloader.java:26)
at com.nordnetab.chcp.main.network.ApplicationConfigDownloader.createInstance(ApplicationConfigDownloader.java:13)
at com.nordnetab.chcp.main.network.JsonDownloader.download(JsonDownloader.java:50)
at com.nordnetab.chcp.main.network.ApplicationConfigDownloader.download(ApplicationConfigDownloader.java:13)
at com.nordnetab.chcp.main.updater.UpdateLoaderWorker.downloadApplicationConfig(UpdateLoaderWorker.java:165)
at com.nordnetab.chcp.main.updater.UpdateLoaderWorker.run(UpdateLoaderWorker.java:75)
at com.nordnetab.chcp.main.updater.UpdatesLoader$1.run(UpdatesLoader.java:61)
at java.lang.Thread.run(Thread.java:818)
03-03 21:05:27.684 2912-3023/io.cordova.hellocordova D/CHCP﹕ Failed to update

image

from cordova-hot-code-push-cli.

nikDemyankov avatar nikDemyankov commented on June 5, 2024

Failed to convert json string into application config
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

This means, that chcp.json is some html page, not a json config. Most likely, it's just not found on the server. That's why no update is coming.

So you need to make sure, that emulator can reach chcp.json. Open YOUR_PROJECT_DIR/platforms/android/res/xml/config.xml and check, what is set as config-file url. Then on the emulator open browser, and try to open that url. It should be a json config.

But as you have read in nordnet/cordova-hot-code-push-local-dev-addon#5 - other developer also tried to use ip as a server address, but eventually switched to some simple server, written on python. So, maybe, if ngrok is blocked for you and emulator can't reach server by ip - this is what you should try to do.

from cordova-hot-code-push-cli.

nordnet-deprecation-bot avatar nordnet-deprecation-bot commented on June 5, 2024

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

😢 We are not using nordnet/cordova-hot-code-push-cli 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 #79 for more information.

from cordova-hot-code-push-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.