Crosswalk 1.3.1 is broken

After upgrading from Crosswalk 1.2.0 to 1.3.1, my Android app now force-closes as it tries to open. Crosswalk 1.2.0 worked fine, but now I can’t revert to that version because I get this error:

$ meteor add crosswalk@=1.2.0
 => Errors while adding packages:

While selecting package versions:
error: No version of crosswalk satisfies all constraints: @=1.2.0, @=1.3.1
Constraints on package "crosswalk":
* crosswalk@=1.2.0 <- top level
* crosswalk@=1.3.1 <- top level

Not sure where else to report this issue… can’t find a GitHub repo for the meteor crosswalk integration and MDG is the package maintainer… so here I am!

Here’s my .meteor/versions

amplify@1.0.0
appshore:leaflet-awesome-markers@1.0.3
autopublish@1.0.4
autoupdate@1.2.3
babel-compiler@5.8.24_1
babel-runtime@0.1.4
base64@1.0.4
binary-heap@1.0.4
blaze@2.1.3
blaze-html-templates@1.0.1
blaze-tools@1.0.4
boilerplate-generator@1.0.4
caching-compiler@1.0.0
caching-html-compiler@1.0.2
callback-hook@1.0.4
check@1.0.6
chrismbeckett:toastr@2.1.2_1
crosswalk@1.3.1
ddp@1.2.2
ddp-client@1.2.1
ddp-common@1.2.1
ddp-server@1.2.1
deps@1.0.9
diff-sequence@1.0.1
dispatch:kernel@0.0.6
dispatch:request-animation-frame@0.0.1
ecmascript@0.1.5
ecmascript-collections@0.1.6
ejson@1.0.7
fastclick@1.0.7
fortawesome:fontawesome@4.4.0
geojson-utils@1.0.4
ground:db@0.3.14
ground:dictionary@0.2.1
ground:localstorage@0.1.9
ground:minimax@1.1.3
ground:servertime@0.0.3
ground:store@0.1.2
ground:util@0.1.17
hot-code-push@1.0.0
html-tools@1.0.5
htmljs@1.0.5
http@1.1.1
id-map@1.0.4
insecure@1.0.4
iron:controller@1.0.8
iron:core@1.0.8
iron:dynamic-template@1.0.8
iron:layout@1.0.8
iron:location@1.0.9
iron:middleware-stack@1.0.9
iron:router@1.0.9
iron:url@1.0.9
joshowens:inflectionizer@0.3.0
jquery@1.11.4
launch-screen@1.0.4
less@2.5.0_3
livedata@1.0.15
logging@1.0.8
matdutour:popup-confirm@0.1.25
meteor@1.1.9
meteor-base@1.0.1
minifiers@1.1.7
minimongo@1.0.10
mobile-experience@1.0.1
mobile-status-bar@1.0.6
momentjs:moment@2.10.6
mongo@1.1.2
mongo-id@1.0.1
mrt:leaflet@0.3.8
mrt:leaflet-label@0.2.1
npm-mongo@1.4.39_1
observe-sequence@1.0.7
ordered-dict@1.0.4
promise@0.5.0
raix:eventemitter@0.1.3
raix:onetimeout@1.0.4
raix:stubfence@1.0.3
random@1.0.4
reactive-dict@1.1.2
reactive-var@1.0.6
reload@1.1.4
retry@1.0.4
routepolicy@1.0.6
session@1.1.1
shcherbin:flex-grid@1.0.5
spacebars@1.0.7
spacebars-compiler@1.0.7
standard-minifiers@1.0.1
templating@1.1.4
templating-tools@1.0.0
tracker@1.0.9
u2622:persistent-session@0.4.3
ui@1.0.8
underscore@1.0.4
url@1.0.5
webapp@1.2.2
webapp-hashing@1.0.5
yauh:turfjs-client@1.0.0

Not sure if this will work for you, but I had to modify some crosswalk files to get it to work with the cordova google maps plugin. To do that I had to make it a local package and add it to meteor, which worked. Basically you just download the crosswalk git repo, and copy and paste it into your /private folder. Crosswalk Repo. Then you can add it locally and possibly debug it.

Just to make sure, you did a meteor remove crosswalk before you tried to add it with the 1.2.0 version constraint correct?

The crosswalk package right now is basically just a package.js that references the Crosswalk plugin. Instead, you should be able to just add the plugin directly (meteor add cordova:cordova-plugin-crosswalk-webview@1.2.0).

But I’m interested in finding out why Crosswalk 1.3.1 isn’t working for you. Is there any way you can track this down? Any error messages either during build or runtime? Anything specific you’re doing (other packages you use, etc.) that might cause this?

Thanks @martijnwalraven and @pmwisdom for your quick replies! Reverting back to crosswalk 1.2.0 with the cordova plugin worked.

As far as 1.3.1 goes…

This appears to be a known issue as described here: https://crosswalk-project.org/jira/browse/XWALK-5077

When I plug in to logcat with my Nexus 5, here’s what I’m seeing:

09-30 10:55:37.328: E/AndroidRuntime(31822): FATAL EXCEPTION: main
09-30 10:55:37.328: E/AndroidRuntime(31822): Process: com.silviaterra.plot_hound, PID: 31822
09-30 10:55:37.328: E/AndroidRuntime(31822): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.silviaterra.plot_hound/com.silviaterra.plot_hound.MainActivity}: java.lang.UnsupportedOperationException: setBackgroundColor
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.ActivityThread.access$800(ActivityThread.java:151)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.os.Handler.dispatchMessage(Handler.java:102)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.os.Looper.loop(Looper.java:135)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.ActivityThread.main(ActivityThread.java:5254)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at java.lang.reflect.Method.invoke(Native Method)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at java.lang.reflect.Method.invoke(Method.java:372)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
09-30 10:55:37.328: E/AndroidRuntime(31822): Caused by: java.lang.UnsupportedOperationException: setBackgroundColor
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:57)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at org.xwalk.core.XWalkView.setBackgroundColor(XWalkView.java:608)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at org.apache.cordova.CordovaActivity.createViews(CordovaActivity.java:186)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:148)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:220)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at com.silviaterra.plot_hound.MainActivity.onCreate(MainActivity.java:32)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.Activity.performCreate(Activity.java:5990)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
09-30 10:55:37.328: E/AndroidRuntime(31822): 	... 10 more
09-30 10:55:37.333: W/ActivityManager(746):   Force finishing activity 1 com.silviaterra.plot_hound/.MainActivity  

So… not sure how to proceed here, but it certainly seems that crosswalk is currently broken on at least some devices.

Thanks for posting the logs. It seems this is actually an issue specifically with setBackgroundColor.

Do you have something like App.setPreference('BackgroundColor', '0xff0000ff') in your mobile-config.js by any chance? That triggers it for me, and when removing it the app runs fine.

The documentation suggests that using CSS (setting background-color on body) would be an alternative.

Mission success - removing the App.setPreference(‘BackgroundColor’… made this issue go away. Thanks!

Removing that pref fixed the issue for me as well. Only reason I had it there was it’s in the example mobile-config.js in the docs. I think it can be removed from that example, since it’s actually setting the background to blue, and I’ve never seen blue in my app :smile:

http://docs.meteor.com/#/full/mobileconfigjs

Thanks for pointing out the issue with crosswalk… In my case I couldn’t even build android app anymore I was getting my .tar.gz file but not the release-unsigned.apk , I removed crosswalk and I could build the release-unsigned.apk again but actually the issue was only with the App.setPreference(‘BackgroundColor’… so in the end crosswalk still work but not with this preference.