Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Plugin load failure on first install Android #70

Closed
alexbuijs opened this issue Dec 16, 2015 · 0 comments
Closed

Plugin load failure on first install Android #70

alexbuijs opened this issue Dec 16, 2015 · 0 comments
Labels
Milestone

Comments

@alexbuijs
Copy link
Contributor

I recently ran into a serious bug where my CI builded APK's where the hot code push plugin was not functioning. Even error events were not emitted. However, my own test builds worked just fine.

After close inspection, the only difference between my test builds and the CI builds, was this one line in the res/xml/config.xml file:

 <widget ...>
     <preference name="loglevel" value="DEBUG" />
     <preference name="loadUrlTimeoutValue" value="60000" />
+    <chcp />
     <feature name="HotCodePush">
         <param name="android-package" value="com.nordnetab.chcp.main.HotCodePushPlugin" />
         <param name="onload" value="true" />

There is an empty chcp tag at the top of the config.xml file. There is a second chcp tag near the bottom that includes the proper config-file tag.

The only difference in my test setup and the CI setup, is that the CI builds the APK's from scratch every time. I could replicate this issue in my test setup by running these commands:

cordova platforms rm android
cordova prepare android --release

You will notice the empty chcp tag in the top. When preparing a second time, the empty chcp tag is removed. I suspect this is a timing issue.

I created a PR that removes the empty tag in the plugin.xml file. This resolves the issue.

alexbuijs added a commit to alexbuijs/cordova-hot-code-push that referenced this issue Dec 16, 2015
This prevents a timing issue where the initial prepare created an empty
chcp tag in config.xml that causes the plugin to stop functioning.
Fixes nordnet#70
@nikDemyankov nikDemyankov added this to the v1.2 milestone Jan 7, 2016
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

2 participants