Conversion to 3.0 Cordova fails to build. ChildBrowser problems?

13 posts, 0 answers
  1. David
    David avatar
    9 posts
    Member since:
    Apr 2013

    Posted 19 Sep 2013 Link to this post

    Hi,
    I'm really excited that 3.0 support has arrived.  I went into my existing project, set the target to 3.0, and tried to build.  But I am now getting the first ever compiler (not js) errors in the log.  It's obviously related to my use of ChildBrowser plugin,  but I admit I am having trouble deciphering the log for what to do next.

    Thanks,
    Dave G

    -compile:
        [javac] Compiling 42 source files to /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/bin/classes
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:38: package org.apache.cordova.api does not exist
        [javac] import org.apache.cordova.api.*;
        [javac] ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:40: cannot find symbol
        [javac] symbol: class CordovaPlugin
        [javac] public class ChildBrowser extends CordovaPlugin {
        [javac]                                   ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:46: cannot find symbol
        [javac] symbol  : class CallbackContext
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]     public CallbackContext callbackContext;
        [javac]            ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:63: cannot find symbol
        [javac] symbol  : class CallbackContext
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]     public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
        [javac]                                                           ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:379: cannot find symbol
        [javac] symbol  : class CordovaInterface
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser.ChildBrowserClient
        [javac]         CordovaInterface ctx;
        [javac]         ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:388: cannot find symbol
        [javac] symbol  : class CordovaInterface
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser.ChildBrowserClient
        [javac]         public ChildBrowserClient(CordovaInterface mContext, EditText mEditText) {
        [javac]                                   ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:64: package PluginResult does not exist
        [javac]         PluginResult.Status status = PluginResult.Status.OK;
        [javac]                     ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:64: package PluginResult does not exist
        [javac]         PluginResult.Status status = PluginResult.Status.OK;
        [javac]                                                  ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:73: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                     callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, "ChildBrowser is already open"));
        [javac]                                                          ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:73: package PluginResult does not exist
        [javac]                     callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, "ChildBrowser is already open"));
        [javac]                                                                                   ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:80: package PluginResult does not exist
        [javac]                     status = PluginResult.Status.ERROR;
        [javac]                                          ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:81: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                     callbackContext.sendPluginResult(new PluginResult(status, result));
        [javac]                                                          ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:84: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                     PluginResult pluginResult = new PluginResult(status, result);
        [javac]                     ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:84: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                     PluginResult pluginResult = new PluginResult(status, result);
        [javac]                                                     ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:95: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                 PluginResult pluginResult = new PluginResult(status, obj);
        [javac]                 ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:95: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                 PluginResult pluginResult = new PluginResult(status, obj);
        [javac]                                                 ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:102: package PluginResult does not exist
        [javac]                     status = PluginResult.Status.ERROR;
        [javac]                                          ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:105: package PluginResult does not exist
        [javac]                 status = PluginResult.Status.INVALID_ACTION;
        [javac]                                      ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:107: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]             callbackContext.sendPluginResult(new PluginResult(status, result));
        [javac]                                                  ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:110: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]             callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
        [javac]                                                  ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:110: package PluginResult does not exist
        [javac]             callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
        [javac]                                                                           ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:126: cannot find symbol
        [javac] symbol  : variable cordova
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]                 intent = new Intent().setClass((Context) cordova.getActivity(), org.apache.cordova.DroidGap.class);
        [javac]                                                          ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:140: cannot find symbol
        [javac] symbol  : variable cordova
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]             cordova.getActivity().startActivity(intent);
        [javac]             ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:182: cannot find symbol
        [javac] symbol  : variable cordova
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]         InputMethodManager imm = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        [javac]                                                       ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:218: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 dialog = new Dialog((Context) cordova.getActivity());
        [javac]                                               ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:247: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 LinearLayout main = new LinearLayout((Context) cordova.getActivity());
        [javac]                                                                ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:250: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 LinearLayout toolbar = new LinearLayout((Context) cordova.getActivity());
        [javac]                                                                   ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:253: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 ImageButton back = new ImageButton((Context) cordova.getActivity());
        [javac]                                                              ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:267: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 ImageButton forward = new ImageButton((Context) cordova.getActivity());
        [javac]                                                                 ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:281: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 edittext = new EditText((Context) cordova.getActivity());
        [javac]                                                   ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:297: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 ImageButton close = new ImageButton(cordova.getActivity());
        [javac]                                                     ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:311: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 webview = new WebView((Context) cordova.getActivity());
        [javac]                                                 ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:314: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 WebViewClient client = new ChildBrowserClient(cordova, edittext);
        [javac]                                                               ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:354: cannot find symbol
        [javac] symbol: variable cordova
        [javac]                 InputStream input = cordova.getActivity().getAssets().open(filename);
        [javac]                                     ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:358: cannot find symbol
        [javac] symbol  : variable cordova
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]         cordova.getActivity().runOnUiThread(runnable);
        [javac]         ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:369: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]             PluginResult result = new PluginResult(PluginResult.Status.OK, obj);
        [javac]             ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:369: cannot find symbol
        [javac] symbol  : class PluginResult
        [javac] location: class com.phonegap.plugins.childBrowser.ChildBrowser
        [javac]             PluginResult result = new PluginResult(PluginResult.Status.OK, obj);
        [javac]                                       ^
        [javac] /tmp/9b0d3215c73d4af19e3a35f65ea33ce5/src/com/phonegap/plugins/childBrowser/ChildBrowser.java:369: package PluginResult does not exist
        [javac]             PluginResult result = new PluginResult(PluginResult.Status.OK, obj);
        [javac]                                                                ^
        [javac] Note: Some input files use or override a deprecated API.
        [javac] Note: Recompile with -Xlint:deprecation for details.
        [javac] 38 errors
  2. Pier Alberto
    Pier Alberto avatar
    16 posts
    Member since:
    Jun 2013

    Posted 19 Sep 2013 Link to this post

    I'm experiencing the same issue, rebuild doesn't work after migrating the project to Cordova 3.0.0. More than this, it seems some features is missing in the library. I use notification and it seems this feature is missing from the Cordova js files imported into the project.

    The Cordova documentation states:
    "As of version 3.0, Cordova implements device-level APIs as plugins. Use the CLI's plugin command, described in The Command-line Interface, to add or remove this feature for a project:"

    So I suppose I have to import the notification feature as a plugin, but I don't know how to do it.
  3. David
    David avatar
    9 posts
    Member since:
    Apr 2013

    Posted 19 Sep 2013 Link to this post

    Hi Pier,
    I'm in the same boat.  Anybody from Telerik have a though about how to proceed?

    Thanks,
    Dave 
  4. Pier Alberto
    Pier Alberto avatar
    16 posts
    Member since:
    Jun 2013

    Posted 19 Sep 2013 Link to this post

    I've just read this in the e-mail announcing the new release:

    "In Apache Cordova 3.0, every core API is taken apart into a plugin on its own-and Icenium can now take advantage of this new architecture. Users will be able to selectively turn on or off any core plugin"

    but I wasn't able to find where the core plugins can be turned on and off.

    Pier Alberto
  5. Iva Koevska
    Admin
    Iva Koevska avatar
    286 posts

    Posted 20 Sep 2013 Link to this post

    Hello,

    As of Icenium 1.8, support for the ChildBrowser is discontinued. You can use it only with Apache Cordova 2.x projects. In an Apache Cordova 3.0 project, you will not be able to build your app with it. Furthermore, Cordova deprecates support for the ChildBrowser as well and recommends using the core InAppBrowser API instead.

    Please, note, that whenever you migrate to another version of Apache Cordova, this might affect any existing custom or integrated plugins in your project. You might need to update them manually to become compatible with the  selected Apache Cordova version (such changes might affect the plugin code, plugin.xml, or even your application code).
     

    Regards,
    Iva Koevska
    Telerik

    Big news for mobile app and .NET developers! Hear about it at our Release Keynote. Thursday, September 26th, 11AM EDT
    Do you enjoy Icenium? Vote for it in Windows IT Pro Community Choice Awards as Best Cloud Computing Product or Service (Category 5).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  6. Chris
    Chris avatar
    1 posts
    Member since:
    Sep 2013

    Posted 22 Sep 2013 Link to this post

    Thats great but it might have been a bit more thoughtful if you had kept support for older versions of Cordova in your Ion app.

    If this is to be a trend in how you do business then I might have to consider finding an alternate platform for my development. I don't want to keep finding my apps break because you move forward without a care in the world for all the apps we are building in older versions.

    I find this concerning that you seemingly had no thought for existing customers who have apps built in prior versions of Cordova.
  7. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 23 Sep 2013 Link to this post

    Hello Chris,

    I want to assure that we do think about existing customers and their apps. For example we still support version 2.0 of Cordova and ChildBrowser plugin is supported in all 2.* versions that Icenium supports. If you build your application with a provisioning profile the plugin will work. 

    Icenium Ion is a testing utility application and it can officially support only one version of Cordova and that will be the latest one Icenium supports. It might work with other versions, but that heavily depends on the internals of the Cordova framework. 

    I would also like to note that Ion is not intended to be used as an application distribution channel, because it might violate Apple terms and conditions. It is a utility app that should be used during initial development only. We strongly recommend that you build and test your applications with development or ad-hoc mobile provisions.

     

    Regards,
    Stefan Dobrev
    Telerik

    Big news for mobile app and .NET developers! Hear about it at our Release Keynote. Thursday, September 26th, 11AM EDT
    Do you enjoy Icenium? Vote for it in Windows IT Pro Community Choice Awards as Best Cloud Computing Product or Service (Category 5).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  8. David
    David avatar
    9 posts
    Member since:
    Apr 2013

    Posted 23 Sep 2013 Link to this post

    Hi Stefan et al,
    I'm just reporting that the fix for me was to remove the inclusion of ChildBrowser in property settings.  Not sure when I turned that on... but my InAppBrowser bits are now compiling and working in 3.0 on Android and iOS.

    Thanks - and for my part the move to 3.0 is very welcome.  Nice work.

    Dave G
  9. Michel
    Michel avatar
    2 posts
    Member since:
    Sep 2013

    Posted 24 Sep 2013 Link to this post

    I'm experiencing a similar problem. I create a kendo project. Don't make any changes. Build the app. It works. Then I open properties, check the childbrowser plugin. Don't make any other changes. Build the app and I get the "Some input files use or override a deprecated API"

    I'm clueless. 
  10. Iva Koevska
    Admin
    Iva Koevska avatar
    286 posts

    Posted 25 Sep 2013 Link to this post

    Hi Michel,

    Starting with Icenium 1.8, support for the ChildBrowser plugin is discontinued and you can use the Icenium-verified plugin to build with only against Apache Cordova 2.x. Because new projects are created to target Apache Cordova 3.0.0, you cannot build your app if it contains the Icenium-verified ChildBrowser plugin.

    Please, also note, that the ChildBrowser plugin is deprecated and Apache Cordova recommends using InAppBrowser instead.

    To work around this, you can choose any of the following approaches:

    •  Change the target Cordova version to 2.x. This might prevent you from testing your app in Ion. You will, however, still be able to test it on a physical device.
      To change the target Cordova version, in the Project Navigator, double-click Properties. In the General tab, from the drop-down menu select a new target Apache Cordova version.
    • Use the InAppBrowser API instead. More information about the API is available here
    Regards,
    Iva Koevska
    Telerik

    Big news for mobile app and .NET developers! Hear about it at our Release Keynote. Thursday, September 26th, 11AM EDT
    Do you enjoy Icenium? Vote for it in Windows IT Pro Community Choice Awards as Best Cloud Computing Product or Service (Category 5).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  11. Michel
    Michel avatar
    2 posts
    Member since:
    Sep 2013

    Posted 25 Sep 2013 Link to this post

    Thank you Iva.

    I was trying the childbrowser plugin because there's no support for embbeded pdf files with Android. With your guidances, I manage to test the childbrowser plugin to find out it is not the best solution for my needs. 

    Many thanks for your help. 
  12. Eric
    Eric avatar
    7 posts
    Member since:
    May 2009

    Posted 27 Sep 2013 Link to this post

    What is the format for the plugin XML when you install the inAppBrowser it does not specify what the plugin XML should look like.  This was a detail that is left out for installing the plugin for cordova 3.0.

    Can you post the contents of the plugin.xml file for the inAppBrowser installed on icenium 1.8?
  13. iliev
    Admin
    iliev avatar
    36 posts

    Posted 28 Sep 2013 Link to this post

    Hello Eric,

    Here are the contents of the InAppBrowser's plugin.xml;

    <?xml version="1.0" encoding="UTF-8"?>

    <plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
               id="org.apache.cordova.core.inappbrowser"
          version="0.1.0">
        <name>InAppBrowser</name>

        <js-module src="www/InAppBrowser.js" name="InAppBrowser">
            <clobbers target="window.open" />
        </js-module>
        
        <!-- android -->
        <platform name="android">
            <config-file target="res/xml/config.xml" parent="/*">
                <feature name="InAppBrowser">
                    <param name="android-package" value="org.apache.cordova.core.InAppBrowser"/>
                </feature>
            </config-file>

            <source-file src="src/android/InAppBrowser.java" target-dir="src/org/apache/cordova/core" />
        </platform>
        
        <!-- ios -->
        <platform name="ios">    
            <config-file target="config.xml" parent="/*">
                <feature name="InAppBrowser">
                    <param name="ios-package" value="CDVInAppBrowser" />
                </feature>
            </config-file>

            <header-file src="src/ios/CDVInAppBrowser.h" />
            <source-file src="src/ios/CDVInAppBrowser.m" />
        </platform>

    </plugin>



    Regards,
    Ilian Iliev
    Telerik

    Do you enjoy Icenium? Vote for it in Windows IT Pro Community Choice Awards as Best Cloud Computing Product or Service (Category 5).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top