0

I am trying to migrate my cordova project to crosswalk.

I am using [following download] (https://download.01.org/crosswalk/releases/crosswalk/android/stable/10.39.235.15/arm/crosswalk-cordova-10.39.235.15-arm.zip) of crosswalk.

My system is having android 4.4 & 4.3 CLI SDK installed. I want to compile my android app for Android 4.3 (API 18).

"cordova -v" command run output :

4.2.0

"cordova platform version android" command run output :

Installed platforms: android 3.6.4
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, windows, windows8, wp8

I am following following link to Migrate cordova project to crosswalk.

VERSION file contains string :

3.6.3

I am getting following error in "ant dbg" stage. Please suggest how to resolve it ?

"ant dbg" command run output :

debug:

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 43 source files to D:\HTML_genny\Git\cordova_projects\2_cr
osswalk\2\test\platforms\android\CordovaLib\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed
in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed
in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use
-Xlint:-options.
    [javac] D:\HTML_genny\Git\cordova_projects\2_crosswalk\2\test\platforms\andr
oid\CordovaLib\src\com\squareup\okhttp\internal\http\HttpsURLConnectionImpl.java
:347: error: method does not override or implement a method from a supertype
    [javac]   @Override public void setFixedLengthStreamingMode(long contentLeng
th) {
    [javac]   ^
    [javac] D:\HTML_genny\Git\cordova_projects\2_crosswalk\2\test\platforms\andr
oid\CordovaLib\src\org\apache\cordova\CordovaActivity.java:302: error: cannot fi
nd symbol
    [javac]         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    [javac]                                                         ^
    [javac]   symbol:   variable KITKAT
    [javac]   location: class VERSION_CODES
    [javac] D:\HTML_genny\Git\cordova_projects\2_crosswalk\2\test\platforms\andr
oid\CordovaLib\src\org\apache\cordova\CordovaActivity.java:309: error: cannot fi
nd symbol
    [javac]                     | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    [javac]                           ^
    [javac]   symbol:   variable SYSTEM_UI_FLAG_IMMERSIVE_STICKY
    [javac]   location: class View
    [javac] D:\HTML_genny\Git\cordova_projects\2_crosswalk\2\test\platforms\andr
oid\CordovaLib\src\org\apache\cordova\IceCreamCordovaWebViewClient.java:86: erro
r: cannot find symbol
    [javac]         return android.os.Build.VERSION.SDK_INT >= android.os.Build.
VERSION_CODES.KITKAT && "content".equals(uri.getScheme());
    [javac]
             ^
    [javac]   symbol:   variable KITKAT
    [javac]   location: class VERSION_CODES
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 4 errors
    [javac] 3 warnings

BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:720: The followin
g error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:734: Compile fail
ed; see the compiler error output for details.

Total time: 4 seconds
Katoch
  • 2,709
  • 9
  • 51
  • 84
  • You might also upvote the related Xwalk issue so that they update crosswalk-cordova to support latest cordova android plugin : https://crosswalk-project.org/jira/browse/XWALK-3402 – Żabojad Mar 30 '15 at 07:09
  • Actually there are two Xwalk tickets with this: https://crosswalk-project.org/jira/browse/XWALK-3491 – Żabojad Mar 30 '15 at 07:26

2 Answers2

0

I've only been using crosswalk 9+cordova 3.5, but I think you should try to use cordova android 3.6.3 instead of 3.6.4 :

cordova platform remove android
cordova platform add android@3.6.3

And then you can follow again the migration guide and replace the cordova-lib with crosswalk-cordova.

And make sure to specify --target "android-19" when building xwalk_core_library.

QuickFix
  • 11,661
  • 2
  • 38
  • 50
  • I created a completely new project of cordova & added android platform 3.6.3 as told by you & used crosswalk "crosswalk-cordova-10.39.235.15-arm" .. followed the same migration guide .. but getting same error.... ?? – Katoch Feb 21 '15 at 09:26
  • please suggest how to get out of it ? – Katoch Feb 21 '15 at 09:26
  • As I said, I haven't tried crosswalk 10 yet. Have you successfully built crosswalk's CordovaLib and xwalk_core_library projects with android sdk 5 before you build your cordova project? – QuickFix Feb 21 '15 at 12:46
  • Or maybe you can try with Crosswalk 9+Cordova 3.5.1, that I can say it works fine. – QuickFix Feb 21 '15 at 12:47
  • Error comes at the step 6 of reference link i am using to migrate project to crosswalk, i.e when build both the CordovaLib and xwalk_core_library projects using following command ...$ ant debug – Katoch Feb 21 '15 at 14:14
  • Means i am not able to build both the CordovaLib and xwalk_core_library – Katoch Feb 21 '15 at 14:17
  • did you use `android update project --subprojects --path . \ --target "android-21"` instead of android-19? (in the sequence of command they first write android-19 but after they write sdk 21 is required) – QuickFix Feb 21 '15 at 23:03
  • My mobile phone is Android-4.3 , i.e (Api 18) so I want to compile my android app for Android 4.3 (API 18). ... so i used following command .. "android update project --subprojects --path . \ --target "android-18" – Katoch Feb 22 '15 at 01:42
  • 1
    targetsdk is not the same as minsdk. Specifying a target sdk does not mean the app will not work on a device with a lower version of android, it means that this sdk will be used to build the app. As the doc clearly indicates that target android 21 should be used to build xwalk_core_library, I really think you should at least give it a try. – QuickFix Feb 22 '15 at 17:28
  • http://developer.android.com/guide/topics/manifest/uses-sdk-element.html this link say something abouttargetSdkVersion ..... Ok i changed the targetsdk version from 18 to 19 .. for both my project & cordovalib .. it compiled successfully .. also size have increased for the apk file. Its compiled successfully & installed well. – Katoch Feb 23 '15 at 06:46
  • But still it does not resolved my problem. Because i want to use chrome view just to get rid of adaptive web design issue for my HTML app. Actually I am working on an opensource project UiMagician. http://www.vscp.org/wiki/doku.php/modules/uimagician .... HTML apps generated by this tool fits well into chrome browser no issue of adaptive webdesign. Most of my design is tested on chrome & layout works fine on small & big size devises as per expectation. Now i want to convert html to mobile-app, But even using chrome as webview of hybrid app .. lay out is not fitting well within the app. – Katoch Feb 23 '15 at 06:52
  • hope fully being a c/c++ programmer i have to see how to resolve this issue .... Thanks for being a lone supporter for my question. – Katoch Feb 23 '15 at 06:54
0

Ok, I've made a little search about the error message you have.

The error says method setFixedLengthStreamingMode(long contentLength) is not found in HttpsURLConnectionImpl.java.

It seems setFixedLengthStreamingMode is new from java 7, so my guess is you are using an older version of java.

To be sure, run java -version in a terminal.If the output displays Java version 1.6.x, then your problem should be solved after upgrading to java 7 or 8.

QuickFix
  • 11,661
  • 2
  • 38
  • 50