最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Polymer on Cordova - Stack Overflow

programmeradmin3浏览0评论

Has anyone a running cordova app with polymer?

I am using angular.js with polymer on cordova, in my Chrome (v37) everything is fine, in the Android debug console i get an error and the screen stays white:

07-03 16:53:26.865: D/CordovaLog(11728): file:///android_asset/www/js/index.js: Line 9899 : Error: Assertion failed
07-03 16:53:26.865: D/CordovaLog(11728):     at c (file:///android_asset/www/polymer/platform/platform.js:12:21781)
07-03 16:53:26.865: D/CordovaLog(11728):     at b (file:///android_asset/www/polymer/platform/platform.js:13:8230)
07-03 16:53:26.865: D/CordovaLog(11728):     at b.F.insertBefore (file:///android_asset/www/polymer/platform/platform.js:13:11769)
07-03 16:53:26.865: D/CordovaLog(11728):     at b.F.appendChild (file:///android_asset/www/polymer/platform/platform.js:13:11720)
07-03 16:53:26.865: D/CordovaLog(11728):     at replaceWith (file:///android_asset/www/js/index.js:6983:16)
07-03 16:53:26.865: D/CordovaLog(11728):     at applyDirectivesToNode (file:///android_asset/www/js/index.js:6282:13)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5958:15)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5970:15)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5970:15)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5970:15)

Polymer is on version 0.3.3 and cordova is 3.5.0-0.2.4, Android is 4.4.4

The app doesnt start and i removed all the html for testing, but the error stays the same

Has anyone a running cordova app with polymer?

I am using angular.js with polymer on cordova, in my Chrome (v37) everything is fine, in the Android debug console i get an error and the screen stays white:

07-03 16:53:26.865: D/CordovaLog(11728): file:///android_asset/www/js/index.js: Line 9899 : Error: Assertion failed
07-03 16:53:26.865: D/CordovaLog(11728):     at c (file:///android_asset/www/polymer/platform/platform.js:12:21781)
07-03 16:53:26.865: D/CordovaLog(11728):     at b (file:///android_asset/www/polymer/platform/platform.js:13:8230)
07-03 16:53:26.865: D/CordovaLog(11728):     at b.F.insertBefore (file:///android_asset/www/polymer/platform/platform.js:13:11769)
07-03 16:53:26.865: D/CordovaLog(11728):     at b.F.appendChild (file:///android_asset/www/polymer/platform/platform.js:13:11720)
07-03 16:53:26.865: D/CordovaLog(11728):     at replaceWith (file:///android_asset/www/js/index.js:6983:16)
07-03 16:53:26.865: D/CordovaLog(11728):     at applyDirectivesToNode (file:///android_asset/www/js/index.js:6282:13)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5958:15)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5970:15)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5970:15)
07-03 16:53:26.865: D/CordovaLog(11728):     at pileNodes (file:///android_asset/www/js/index.js:5970:15)

Polymer is on version 0.3.3 and cordova is 3.5.0-0.2.4, Android is 4.4.4

The app doesnt start and i removed all the html for testing, but the error stays the same

Share Improve this question edited Jul 11, 2014 at 7:14 pfried asked Jul 3, 2014 at 15:47 pfriedpfried 5,0892 gold badges41 silver badges78 bronze badges 1
  • I'm trying it out on Chrome (36) beta but not Cordova. I've had problems with binding. Specifically ngNodel doesn't work for things like paper-checkbox. Also, custom properties don't seem to bind correctly. Look at angular-bind-polymer to see if it works for you github./eee-c/angular-bind-polymer. – ipaul Commented Jul 3, 2014 at 16:06
Add a ment  | 

5 Answers 5

Reset to default 5

I got it working with Android 4.4. I've heard rumors you can use Crosswalk to get it working with earlier versions of Android.

I made a tutorial of my Polymer Cordova project here:

https://www.thepolyglotdeveloper./2014/07/use-polymer-apache-cordova/

Nics tutorial is really good. Thanks Nic.

Moreover I remend to check Chrome Dev Editor, it has already built in everything to play and run.

MobileChromeApps https://github./MobileChromeApps/mobile-chrome-apps

ChromeDevEditor https://github./dart-lang/chromedeveditor

Hope it helps.

I am using Polymer with Cordova on iPhone 6, and it works really well.

It works fine for me on 4.4.4 but I needed to support earlier versions so I used MobileChromeApps which uses Cordova and crosswalk to deploy your app with chrome instead of using the default browser that isnt supported by polymer.

This worked fine for me but on iOS it's not using chrome and is using the default webView which is safari which doesn't seem to work with MobileChromeApps but does work with plain old Cordova. Uuugh.

Anyone got cross walk working for iOS with MobileChromeApps?

I've had also a lot of problems making Polymer 1.0 work. For me the solution was to solve CORS (Cross scripting), App security related problems. The trick was to add the following in the config.xml.

<gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.2.1" />

With the options

<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<access origin="*" />

It's not secure to use them in this way (you allow everything, to everybody). But it gave me access to Polyfill and other Stuff, using external CDN servers. Which were at first blocking me, showing a white screen.

发布评论

评论列表(0)

  1. 暂无评论