0
votes

I'm just building a starter app with polymer starter toolkit.

Everything was fine till yesterday. I could build android app with cordova and run it straight to my android device. Now I've added a new route in routing.html called login where I did setup a simple firebase connection as well.

<script src="../../bower_components/page/page.js"></script>
<script>
  window.addEventListener('WebComponentsReady', function() {

    // We use Page.js for routing. This is a Micro
    // client-side router inspired by the Express router
    // More info: https://visionmedia.github.io/page.js/
    page('/', function () {
      app.route = 'home';
    });

    page('/users', function () {
      app.route = 'users';
    });

    page('/users/:name', function (data) {
      app.route = 'user-info';
      app.params = data.params;
    });

    page('/contact', function () {
      app.route = 'contact';
    });

    page('/login', function () {
      app.route = 'login';
    });

    // add #! before urls
    page({
      hashbang: true
    });

  });
</script>

If I run it local in chrome it work really well. But then when built with cordova and I click on the menu to open a page that error appear:

Image 1:menu

Application error

Anything to do with the new route or the firebase connection?

2

2 Answers

0
votes

@Dragod83
It has to do with polymer being new and not support by many browser.

Polymer - Browser Compatibility

In it you will see that Android is support, but they fail to give a version. We can assume it is the latest - using Lolipop or better. Even so, the library that is used for Phonegap development is not that current.

It might working with crosswalk, but I have not information on that either way.

In short, polymer is not ready for prime-time, and therefore not ready for use with Cordova or Phonegap. This may change, but polymer has been slow in giving details for using polymer on hybrid platforms.

Best of Luck

0
votes

Solved. For some reason (unknown to me) I had to create a folder named android_asset inside

AndroidStudioProject/myappname/app/src/main/android_asset

Then I paste the content of www folder and it's now working.

Also replaced jQuery & firebase CDN link with bower. Look like file that require a connection do not work.

https://github.com/PolymerElements/polymer-starter-kit/issues/374