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

Plugin load failure on first install Android #70

@alexbuijs

Description

@alexbuijs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions