This is a migrated thread and some comments may be shown as answers.

Childbrowser on Android Built issues

4 Answers 26 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian
Top achievements
Rank 1
Brian asked on 20 Mar 2013, 03:01 PM
I have a project that works great on the run on device debugging, however when using the Publish / build feature the apk that is build does not work.

It just returns the error: Cannot read property 'ChildBrowser' of undefined.

I am using Cordova v2.4.0 with Childbrowser 4.1 and I run the includes like this:

 <!-- INIT UI SCRIPTS -->
         <script type="text/javascript" charset="utf-8"  src="cordova.js"></script>
        <script type="text/javascript" charset="utf-8"  src="kendo/js/jquery.min.js"></script>
        <script type="text/javascript" charset="utf-8"  src="kendo/js/kendo.mobile.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="Plugins/Child Browser/childbrowser.js"></script>

Any thoughts would be greatly appreciated.

4 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 20 Mar 2013, 03:15 PM
This is how I am calling child browser:

        if(window.plugins.childBrowser == null)
    {
    ChildBrowser.install();
    }

        window.plugins.childBrowser.onLocationChange =  function(loc){ facebookLocChanged(loc); };
        window.plugins.childBrowser.showWebPage(authorize_url);

It didn't work when the first check wasn't their either (the childBrowser.install();)  , as I am not sure that is required, b ut I added it in to debug and be sure.
0
Brian
Top achievements
Rank 1
answered on 20 Mar 2013, 04:08 PM
And again, it works great in the icenium version of the install,  just not when built to an APK in Icenium Graphite.  Exact same code.
0
Steve
Telerik team
answered on 20 Mar 2013, 05:05 PM
Hello Brian,

You've hit this bug, the good news is that we've already fixed it, but the fix would make it for subsequent release of Cordova. The issue is that the path to childbrowser.js has a space and therefore the script cannot be loaded. The easiest workaround is to copy the contents of childbrowser.js in a separate file which path does not have spaces and reference this file instead.

On a side note, yesterday we've released Icenium v1.3 where we introduced Cordova v2.4 support and therefore you should be able to use InAppBrowser directly, instead of the childBrowser plug-in.

Regards,
Steve
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
Brian
Top achievements
Rank 1
answered on 20 Mar 2013, 05:28 PM
That worked.  Thank you.    We plan on changing to use the new inappbrowser in the future as well.
Tags
Report a bug
Asked by
Brian
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Steve
Telerik team
Share this question
or