Childbrowser on Android Built issues

5 posts, 0 answers
  1. Brian
    Brian avatar
    6 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2013 Link to this post

    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.

  2. Brian
    Brian avatar
    6 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2013 Link to this post

    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.
  3. Brian
    Brian avatar
    6 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2013 Link to this post

    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.
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 20 Mar 2013 Link to this post

    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.
  5. Brian
    Brian avatar
    6 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2013 Link to this post

    That worked.  Thank you.    We plan on changing to use the new inappbrowser in the future as well.
Back to Top