4
I’m using this module that automatically adds a Crosswalk wrapper to a Cordova project.
Obs: It requires "Platform" to be [email protected].
Okay, then I give the command to Wrap the Crosswalk in the project and everything goes well.
It builds normally with the plugin dialogs and others. However when I install the Splashscreen plugin and try to give run, an error happens:
-pre-compile:
[echo] Set jars path to: /home/rop/Projetos/Pray/cordovaa2/platforms/android/CordovaLib/ant-build/classes.jar:/home/rop/Projetos/Pray/cordovaa2/platforms/android/CordovaLib/xwalk_core_library/ant-build/classes.jar:/home/rop/Projetos/Pray/cordovaa2/platforms/android/CordovaLib/xwalk_core_library/libs/xwalk_core_library_java_app_part.jar:/home/rop/Projetos/Pray/cordovaa2/platforms/android/CordovaLib/xwalk_core_library/libs/xwalk_core_library_java_library_part.jar
-compile:
[javac] Compiling 5 source files to /home/rop/Projetos/Pray/cordovaa2/platforms/android/ant-build/classes
[javac] warning: /home/rop/Projetos/Pray/cordovaa2/platforms/android/CordovaLib/xwalk_core_library/libs/xwalk_core_library_java_app_part.jar(org/xwalk/core/XWalkView.class): major version 51 is newer than 50, the highest major version supported by this compiler.
[javac] It is recommended that the compiler be upgraded.
[javac] /home/rop/Projetos/Pray/cordovaa2/platforms/android/src/org/apache/cordova/splashscreen/SplashScreen.java:232: cannot find symbol
[javac] symbol : method canGoBack()
[javac] location: class org.apache.cordova.CordovaWebView
[javac] if (webView.canGoBack()) {
[javac] ^
[javac] 1 error
[javac] 1 warning
BUILD FAILED
/opt/android-sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/opt/android-sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 4 seconds
/home/rop/Projetos/Pray/cordovaa2/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: ant with args: debug,-f,/home/rop/Projetos/Pray/cordovaa2/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
ERROR running one or more of the platforms: Error: /home/rop/Projetos/Pray/cordovaa2/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project
My folder structure:
My config.xml:
<?xml version="1.0" encoding="utf-8"?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>appName</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<platform name="android">
<splash src="res/android/screen/res-long-port-hdpi/default.png" densitit="port-hdpi"/>
<splash src="res/android/screen/res-long-port-ldpi/default.png" densitit="port-ldpi"/>
<splash src="res/android/screen/res-long-port-mdpi/default.png" densitit="port-mdpi"/>
<splash src="res/android/screen/res-long-port-xhdpi/default.png" densitit="port-xhdpi"/>
<icon src="res/android/icon/drawable-ldpi/appicon/png" density="ldpi" />
<icon src="res/android/icon/drawable-mdpi/appicon.png" density="mdpi" />
<icon src="res/android/icon/drawable-hdpi/appicon.png" density="hdpi" />
<icon src="res/android/icon/drawable-xhdpi/appicon.png" density="xhdpi" />
</platform>
</widget>
PS: Also, even icons don’t work, although they don’t depend on Plugins... Every time I run, the app installs with the default icon of Cordova.
You gave command of the
crosswalk
before or after adding the Splashscreen Plugin?– Pedro Henrique
What instructions are you using to compile? What is the compiler version?
– Victor Stafusa
@Victorstafusa, use Cordova 4.2.0, Android 5.1 API 22. Use the 'android run Cordova' but from this error I have installed the splashscreen plugin (without it builds normal).
– ropbla9
If you give a
javac -version
, what appears?– Victor Stafusa
@Victorstafusa 1.6.0_34
– ropbla9
I searched the code on line 232 of the file
/splashscreen/SplashScreen.java
and I realized that it really calls a functioncanGoBack
of a Webview variable, such ascrosswalk
changes the application to use theChromium webview
I believe it does not have this function or implementation. So make sure that when performing thecrosswalk
to convert the project you ta have the plugin installed.– Pedro Henrique
@Pedrohenrique, I have the plugin in the Plugins folder of the project. I am using this module to facilitate the process of installing Crosswalk https://www.npmjs.com/package/cordova-android-crosswalk. It requires the android platform in version 3.6.3.
– ropbla9
@ropbla9 I was able to reproduce the error, I will make some tests and I will inform you.
– Pedro Henrique