Search code examples
cordovadartdart-polymer

Run Polymer Dart from Cordova using pub serve


I'm trying to run a polymer dart app from Cordova via pub serve.

Here's what I tried:

  1. Used the generated polymer project from stagehand, latest web storm (11.0.3), latest dart dev build (1.14.0-dev.5.0).
  2. Disabled app transport security (for iOS, plist entry, there's a cordova plugin for that).
  3. config.xml: I set both access origin, and allow navigation to *.
  4. Set <content src="http://localhost:8080/index.html" /> instead of <content src="index.html" /> (also tried to put the LAN IP instead of localhost).
  5. csp: true in $dart2js and web_components transformers.
  6. Used Content-Security-Policy meta tag to allow pretty much everything.
  7. Ran pub serve --hostname 0.0.0.0.
  8. cordova run ios -> then I get a white blank app.

Solution

  • The "fix" was to use a later version of Cordova.

    Had this issue with 5.1.1, when I updated to the latest (5.4.1 at the moment of writing), it works fine, didn't even need to re-create the Cordova project folder.

    I went back and forth between these 2 versions to verify that this was the problem.