GithubHelp home page GithubHelp logo

isleofcode / corber Goto Github PK

View Code? Open in Web Editor NEW
332.0 14.0 100.0 6.11 MB

CLI for building hybrid apps with Ember/Vue/Glimmer/Cordova

Home Page: http://corber.io

License: MIT License

JavaScript 99.63% HTML 0.37%
cli ember-cordova isle cordova phonegap ember vue glimmer hybrid-apps

corber's Introduction

Corber Build Status

Corber is a CLI that improves the hybrid app build experience for Vue, Ember, Glimmer, and React apps using Cordova.

Corber handles framework and app builds and validations with a single command: corber build - without affecting existing web flows. The CLI also includes on-device livereload for development and utility functions for icons, plugins, and more. And when needed, it can proxy to the Cordova CLI.

It is a continuation of the ember-cordova project. ember-cordova users can find details here, and continue to access the existing ember addon and documentation. For migration instructions, see Migrating from Ember Cordova.

Installation

# Yarn
yarn global add corber

# NPM
npm install -g corber

Initialize Corber

  1. Change to your project directory.
  2. Run corber init.
  3. Select iOS and press space to select the platform.

Configure Your Project for Corber

Vue CLI 3

  1. Open vue.config.js. (Create file in project root if it doesn't exist. See Example Vue Config.)
  2. Require corber-webpack-plugin and assign it as CorberWebpackPlugin.
  3. Add new CorberWebpackPlugin() to the configureWebpack.plugins array.

For Vue CLI 2 or Non-Vue CLI, see Configure Vue CLI 2 or Non-Vue CLI projects.

Ember

  1. Open config/environment.js.
  2. Set locationType to hash.
  3. Update rootURL or baseURL to remove its leading slash, if it has one.

Extending Frameworks

Corber comes with built-in support for Vue, Ember, and React, but can be extended to work with the framework of your choice. See Extending Corber to Support Other Frameworks.

Run App on an Emulator with Live Reload

  1. Run corber start.
  2. Select an emulator.

Build, Flash, and Run App on Your Device

  1. Run corber build. (Ignore error code 65 error, signing will be set in step 3.)
  2. Run corber open to open the Xcode project.
  3. First Time Only: In Xcode, select the Project Navigator, select your project, and under Signing, set your Team.
  4. Connect your iPhone via its USB cable. (Accept the "Trust This Computer?" alert if prompted.)
  5. In Xcode, select your connected device in the toolbar.
  6. Press the Play button to flash and run the app on your device.

For Android builds see Android Setup. For full documentation, please visit corber.io.

Contributing

Pull requests are very welcome. You can read our style guides here.

If you are unsure about your contribution idea, please feel free to open an issue for feedback.

Find an issue with our documentation? All docs are hosted on this repo under the gh-pages branch.

Credits

Corber is maintained by Isle of Code.

corber's People

Contributors

a6brgeuka avatar adamniedzielski avatar ahmacleod avatar alexblom avatar anulman avatar billybonks avatar bryanh avatar danielochoa avatar ddoria921 avatar dependabot[bot] avatar dubistkomisch avatar dukex avatar ffissore avatar greenkeeper[bot] avatar greis avatar jakecraige avatar jbrown avatar jcowley avatar jdurand avatar jelhan avatar jhilden avatar jordanyee avatar kiwi-josh avatar machty avatar oskarrough avatar osxi avatar reidab avatar runspired avatar tobiaswerner avatar utilityboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

corber's Issues

Geolocation features no longer working after latest update.

It is quite weird, all geolocation features are not working when built for android even tho i did ember cordova plugin add cordova-plugin-geolocation

it all work fine, all i did was:
upgraded cordova to 6.3.0 frm 6.2.0
upgraded to ember 2.7
upgraded to ember-cordova 0.2

Passing extra arguments when building cordova?

Thanks for all the hard work on this project ๐Ÿ‘ ๐Ÿ‘

I'm using it with cordova-hot-code-push, which supports passing extra arguments to cordova build for different environments. Example. Eg:

cordova build -- chcp-dev

This doesn't work:

ember cdv:build -- chcp-dev

From looking at the code it's pretty obvious it won't work. Is it possible to pass through the chcp-dev option in another way?

Alternatively, the changes being made as a result of passing through chcp-dev could be put into hooks.

Regards,
-Jonathan.

Passing --environment=production does not trigger a release build

I'm running:

ember cordova:build --platform=android --environment=production

According to this line https://github.com/isleofcode/ember-cordova/blob/59bc6c00e473e2083cf4cfd34727b7468d0c0187/lib/tasks/cordova-build.js#L11 it should append --release to the Cordova command.

However, when this function is invoked (https://github.com/isleofcode/ember-cordova/blob/59bc6c00e473e2083cf4cfd34727b7468d0c0187/lib/commands/build.js#L57) the environment parameter is not passed, so this condition is always false (undefined === "production")

Paths issue

Hi, I'm hitting this issue on a new ember-cli 2.7.0 project while running ember cdv:build.
Have you seen this before?

TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.join (path.js:1213:7) at blabla/node_modules/ember-cordova/index.js:63:29 at Array.forEach (native) at CoreObject.module.exports.treeForPublic (blabla/node_modules/ember-cordova/index.js:62:13) at CoreObject._treeFor (blabla/node_modules/ember-cli/lib/models/addon.js:373:33) at CoreObject.treeFor (blabla/node_modules/ember-cli/lib/models/addon.js:341:21) at blabla/node_modules/ember-cli/lib/broccoli/ember-app.js:498:20 at Array.map (native) at EmberApp.addonTreesFor (blabla/node_modules/ember-cli/lib/broccoli/ember-app.js:496:30)

What's the pattern for building an app that may or may not be run in a cordova context?

Presumably we should wait for the deviceready promise in the cordova service within application route's beforeModel hook, but what if you're writing an app that has a cordova target AND a web app target? Would be nice if the cordova service gave you a promise to wait for that resolved immediately if it detected that it wasn't running in a cordova context.

Ember cdv:serve failing

ember-cordova: 0.1.4
ember-cli: 2.5.0
node: 5.3.0
os: darwin x64

$ ember cdv:serve

โ ‹ Buildingember-cordova: /Projects/js/cdv6/cdv/ember-cordova/cordova/platforms/ios/www/cordova_plugins.js did not exist. It is required for Device LiveReload to work.

Symlinked dist/ to cordova/wwww

ember-cordova: /Projects/js/cdv6/cdv/ember-cordova/cordova/platforms/ios/www/cordova_plugins.js did not exist. It is required for Device LiveReload to work.

File: /bin/sh

Command failed: EMBER_CORDOVA=true CORDOVA_RELOAD_ADDRESS=http://localhost:4200 CORDOVA_PLATFORM=ios EMBER_CORDOVA=true ember build --environment development

Error: Command failed: EMBER_CORDOVA=true CORDOVA_RELOAD_ADDRESS=http://localhost:4200 CORDOVA_PLATFORM=ios EMBER_CORDOVA=true ember build --environment development

    at checkExecSyncError (child_process.js:464:13)
    at execSync (child_process.js:504:13)
    at /Projects/js/cdv6/cdv/node_modules/ember-cordova/lib/tasks/bash.js:23:7
    at lib$rsvp$$internal$$initializePromise (/Projects/js/cdv6/cdv/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
    at PromiseExt.lib$rsvp$promise$$Promise (/Projects/js/cdv6/cdv/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
    at new PromiseExt (/Projects/js/cdv6/cdv/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at Class.module.exports.Task.extend.run (/Projects/js/cdv6/cdv/node_modules/ember-cordova/lib/tasks/bash.js:17:12)
    at Class.module.exports.Task.extend.run (/Projects/js/cdv6/cdv/node_modules/ember-cordova/lib/tasks/build.js:44:23)
    at Class.module.exports.run (/Projects/js/cdv6/cdv/node_modules/ember-cordova/lib/commands/serve.js:58:18)
    at Class.<anonymous> (/Projects/js/cdv6/cdv/node_modules/ember-cli/lib/models/command.js:152:17)

Install fails for Cordova 6.2.0

  • ember new isleofcode
  • cd isleofcode/
  • ember install ember-cordova
Error: Cannot find module 'config-chain'
File: /bin/sh
Command failed: cordova create cordova isleofcode isleofcode
Error: Command failed: cordova create cordova isleofcode isleofcode
    at checkExecSyncError (child_process.js:464:13)
    at execSync (child_process.js:504:13)
    at /Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cordova/lib/tasks/bash.js:23:7
    at lib$rsvp$$internal$$initializePromise (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
    at PromiseExt.lib$rsvp$promise$$Promise (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
    at new PromiseExt (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at Class.module.exports.Task.extend.run (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cordova/lib/tasks/bash.js:17:12)
    at Class.module.exports.Task.extend.run (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cordova/lib/tasks/create-cordova-project.js:30:21)
    at Class.module.exports.afterInstall (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cordova/blueprints/ember-cordova/index.js:42:19)
    at lib$rsvp$$internal$$tryCatch (/Users/<user>/Projects/tmp/isleofcode/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)

Handling "deviceready" event with "cordova" service

Thank you for creating this addon!

I would like to report one inconsistency in how deviceready event is handled. In Cordova docs (https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready):

The deviceready event behaves somewhat differently from others. Any event handler registered after the deviceready event fires has its callback function called immediately.

However, from what I have observed, this is not the case when using cordova service:

// this invokes "vibrate" function
document.addEventListener("deviceready", this.vibrate.bind(this), false);
// this does not invoke "vibrate" function presumably because the event already fired long time ago
this.get("cordova").on("deviceready", this, "vibrate");

What do you think? Should we match the "unwrapped" behaviour?

ember install ember-cordova fails

On a new Ember 2.6 projects, installation of the addon fails with the following:

โฏ ember install ember-cordova                                                           [13:30:01]
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
โ ง Installing packages for tooling via npmConsidering PhantomJS found at /usr/local/bin/phantomjs
Looks like an `npm install -g`
Linking to global install at /usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs
Writing location.js file
Installed packages for tooling via npm.
/projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:16
   return new Promise(() => {
                       ^
Unexpected token )
/projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:16
   return new Promise(() => {
                       ^
SyntaxError: Unexpected token )
   at exports.runInThisContext (vm.js:73:16)
   at Module._compile (module.js:443:25)
   at Object.Module._extensions..js (module.js:478:10)
   at Module.load (module.js:355:32)
   at Function.Module._load (module.js:310:12)
   at Module.require (module.js:365:17)
   at require (module.js:384:17)
   at Object.<anonymous> (/projects/embercordova/node_modules/ember-cordova/lib/tasks/ember-build.js:4:23)
   at Module._compile (module.js:460:26)
   at Object.Module._extensions..js (module.js:478:10)
>>>elapsed time 35s

Migrating from ember-cli-cordova

Any special tricks I need to do to migrate existing project from ember-cli-cordova?
Is it possible to highlight the path in the readme?

docs - how to use splash screens

It should be noted in the docs how to use splash screens and icons. It doesn't match the docs for cordova-plugin-splashscreen. In that it says to add XML configs for splashscreen locations, but b/c those don't match that fails the build. The correct thing seems to be to not include any extra xml.

Also I recommend adding links to https://github.com/AlexDisler/cordova-splash and https://github.com/AlexDisler/cordova-icon for generating the images. As a handy helpful tip for cordova folk.

Broken release, can't even work with simple welcome to ember app.

Here is my enviorment config :

/* jshint node: true */

module.exports = function(environment) {
  var ENV = {
    modulePrefix: 'client',
    environment: environment,
    baseURL: '/',
    defaultLocationType: 'auto',
    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      }
    },

    APP: {
      // Here you can pass flags/options to your application instance
      // when it is created
    },

    cordova: {
      rebuildOnChange: false,
      emulate: false,
      platform: 'android'
    }
  };

  if (environment === 'development') {
    // ENV.APP.LOG_RESOLVER = true;
    ENV.APP.LOG_ACTIVE_GENERATION = true;
    // ENV.APP.LOG_TRANSITIONS = true;
    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    ENV.APP.LOG_VIEW_LOOKUPS = true;
  }

  if (environment === 'test') {
    // Testem prefers this...
    ENV.baseURL = '/';
    ENV.locationType = 'none';

    // keep test console output quieter
    ENV.APP.LOG_ACTIVE_GENERATION = false;
    ENV.APP.LOG_VIEW_LOOKUPS = false;

    ENV.APP.rootElement = '#ember-testing';
  }

  if (environment === 'production') {

  }

  return ENV;
};

when
ember cordova:build
and
ember cordova:emulate
After splash is run on device , always "File not found" any every single jss /css /wahtever.
only index.html is ported?

Font icons not displayed on a device

I have icons inside font files (.eot, .svg, .ttf, .woff) sitting in the "public" folder. Everything works great when I use ember cdv:serve and test on a simulator, however, when I create a build and run on a device no icons are displayed.

Can't use cordova create --template

It would be great if you could pass a template through to the cordova create command.

$ ember install ember-cordova --template ../ember-cordova-template/
The option '--template' is not registered with the install command. Run `ember install --help` for a list of supported options.
 Could not install /Users/jb/code/ember-cordova-template
EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
    at Error (native)

Don't understand this build failure

When I try a cordova build with ember cdv:build --platform=android, the build fails with

`Error: ember-cordova: You must specify the locationType as 'hash' in your environment.js.
at Class.module.exports.validateLocationType (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cordova/lib/commands/build.js:66:13)
at Class.module.exports.run (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cordova/lib/commands/build.js:28:10)
at Class. (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cli/lib/models/command.js:152:17)
at lib$rsvp$$internal$$tryCatch (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (/home/billy/BitBucket/Personal/wheres-my-ride/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)

I do have locationType: 'hash', in my environment.js file, and I also tried using defaultLocationType as is done in ember-cli-cordova. No love. It seems locationType in the validateLocationType() function comes back as undefined.

I fear this is a dumb newbie question, so apologies in advance, but ... what am I missing?

thx.

-Billy B
`

Complaining about missing IOS cordova path but only build platform is android.

I am building with ember cdv:build
but after update i got this error :

Built project successfully. Stored in "dist/".
Symlinked dist/ to cordova/www
 Using this version of Cordova with older version of cordova-ios is being deprecated. Consider upgrading to [email protected] or newer.
Error: The provided path "/home/v3ss/workspace/wavelocator/client/ember-cordova/cordova/platforms/ios" is not a Cordova iOS project.

i am building android

here is my env

/* jshint node: true */

module.exports = function(environment) {
  var ENV = {
    modulePrefix: 'client',
    environment: environment,
    rootURL: '/',
    locationType: 'hash',
    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      }
    },

    APP: {
      // Here you can pass flags/options to your application instance
      // when it is created
    },

    cordova: {
      rebuildOnChange: false,
      emulate: false,
      platform: 'android'
    }
  };

  if (environment === 'development') {
    // ENV.APP.LOG_RESOLVER = true;
    ENV.APP.LOG_ACTIVE_GENERATION = true;
    // ENV.APP.LOG_TRANSITIONS = true;
    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    ENV.APP.LOG_VIEW_LOOKUPS = true;
  }

  if (environment === 'test') {
    // Testem prefers this...
    ENV.baseURL = '/';
    ENV.locationType = 'none';

    // keep test console output quieter
    ENV.APP.LOG_ACTIVE_GENERATION = false;
    ENV.APP.LOG_VIEW_LOOKUPS = false;

    ENV.APP.rootElement = '#ember-testing';
  }

  if (environment === 'production') {

  }

  return ENV;
};

deviceready race condition

My application route is as follows:

import Ember from 'ember';
import subscribe from 'ember-cordova/utils/subscribe';

const {
  inject,
  Route
} = Ember;

export default Route.extend({
  cordova: inject.service(),

  logReady: subscribe('cordova.deviceready', function() {
    window.navigator.splashscreen.hide();
  })
});

I sometimes get a fatal error like this...

screen shot 2016-08-15 at 5 37 24 pm

After reading the cordova service code I saw the ready method and once I switched to that I had no further issues.

activate() {
  this.get('cordova').ready().then(() => {
    window.navigator.splashscreen.hide();
  });
}

Any thoughts on why subscribing to deviceready would cause that? I'm happy to update the docs to suggest using that ready promise, it seems like a more reliable approach.

Having issues with LiveReload

This is my first foray into Cordova so please bear with me. Here is what I attempted:

  • Installed ember-cli-cordova and got it up and running (including running the generator - I'm only using iOS right now)
  • Remembered @alexblom's talk from EmberConf and realized the more up-to-date addon was ember-cordova so switched to that
  • Moved the cordova -> ember-cordova/cordova
  • Got it to the point that ember cordova:open would open in XCode and I could hit build to run it

Next I tried to get LiveReload working:

  • Followed all the instructions here
  • My allow-navigation config in ember-cordova/cordova/config.xml is currently set to * to remove any additional potential problems from that
  • My ember-cordova config in environment.js is currently set to the following:
{
  cordova: {
    rebuildOnChange : false,
    emberUrl        : `http://${addresses[0]}:4200`,
    reloadUrl       : `http://${addresses[0]}:4200`,
    liveReload      : {
      enabled  : true,
      platform : 'ios'
    },
  }
}

I have tried both 4200 and 49154 for the reloadUrl considering I wasn't sure what the docs meant. I would assume it would just use emberUrl if that's what it wanted but since the reloader is serving from 49154 my assumption is that reloadUrl is looking for that and not the emberUrl.

Either way, neither of them worked.

  • Executed ember cordova:serve This does all the stuff, but the docs make it seem as though it should launch the app, however it does not.
  • Executed ember cordova:open in a separate tab. This opens XCode, but does not run the app
  • Run the build in XCode. App opens successfully in Simulator and is pulling from the emberUrl
  • Changed the app in my editor (simple HTML change in index.html)

Expected Result

App in simulator refreshes to reflect those changes

Actual Result

App in simulator does not refresh

More Information

Interestingly, even if I quit Simulator and rebuild the app in XCode I still don't see the changes. I must completely rebuild the entire app to see changes to the code.

Workflow

Sorry for posting this here. Not sure if this is the right place

Here is what I'm doing:

I start my ember server and create the UI like a webapp then I run ember cordova run ios --device to run in my iPhone.

My API is a Rails app running in my own computer, then I deployed the api to Heroku and changed the API address point based on the environment.

It looks like that the run option doesn't know my production environment.

Now, I run ember cordova:build --environment=production --platform=ios && ember cordova run ios --device to simulate but this is slow.

Is that workflow correct? Is there any way to improve this workflow?

I also tried the live reload

ember cordova:serve --platform=ios and
ember cdv:open โ€”-platform=ios

But it doesn't look as I was looking for.

Any suggestions to improve the workflow?

Sample or Reference app required

It would be nice to have a sample app, which kind of will help early adopters. It should atleast cover basic features provided by ember-cordova.
Ember-Cli-Cordova creator had done this - https://vimeo.com/107885050

I have been facing bunch of issues. One of it is how to getride of splash screen.

Even after this it is not loading my app. still stuck at splash screen.

// app/routes/application.js
import Ember from 'ember';
import SplashscreenMixin from 'ember-cordova/mixins/device/splashscreen';

const { Route } = Ember;

export default Route.extend(SplashscreenMixin, {
    beforeModel() {
      this.get('splashscreen').hide();
    },

    model() {
      return ['red'];
    }
});

'EMBER_CORDOVA' is not recognized as an internal or external command, operable program or batch file.

ember cordova:serve --platform=android --reload-url=localhost:4200

**'EMBER_CORDOVA' is not recognized as an internal or external command,
operable program or batch file.**
....

BUILD SUCCESSFUL

Total time: 7.843 secs
Built the following apk(s): 
    E:/.../ember-cordova/cordova/platforms/android/build/outputs/apk/android-debug.apk
**'EMBER_CORDOVA' is not recognized as an internal or external command,**
operable program or batch file.

npm ERR! Windows_NT 10.0.10586

I'm running the latest version of ember-cordova.

Add docs about ember cordova run

I use ember cordova run and ember cordova run --device quite a bit. I think they should be added to the docs, and possible to a cdv:run. I think there is a build requirement of ios-deploy, and something for android, but I don't recall.

/bin/sh: cordova: command not found

On a fresh ember app, just after doing ember new my-app I install ember-cordova and am getting this error:

โžค ember install ember-cordova                          git:master
Installed packages for tooling via npm.
installing ember-cordova
  create /ember-cordova/.npmignore
/bin/sh: cordova: command not found
File: /bin/sh
Command failed: cordova create cordova sympstruments sympstruments
Error: Command failed: cordova create cordova sympstruments sympstruments
    at checkExecSyncError (child_process.js:464:13)
    at execSync (child_process.js:504:13)
    at /Users/devinrhode2/repos/sympstruments/node_modules/ember-cordova/lib/tasks/bash.js:23:7
    at lib$rsvp$$internal$$initializePromise (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
    at PromiseExt.lib$rsvp$promise$$Promise (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
    at new PromiseExt (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at Class.module.exports.Task.extend.run (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cordova/lib/tasks/bash.js:17:12)
    at Class.module.exports.Task.extend.run (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cordova/lib/tasks/create-cordova-project.js:30:21)
    at Class.module.exports.afterInstall (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cordova/blueprints/ember-cordova/index.js:42:19)
    at lib$rsvp$$internal$$tryCatch (/Users/devinrhode2/repos/sympstruments/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
sympstruments โžค

exeption nativeEvalAndFetch : ReferenceError: Can't find variable: cordova global code - index.html:1:127

I checked out the emberjs example super-rentals app: https://github.com/emberjs/super-rentals. After installing all of the dependencies, I opened 2 tabs:

In tab1

  • I ran command: ember cdv:serve
  • Checking in the browser with url: localhost:4200, the website showed up correctly

In tab2

  • I ran command: ember cdv:buid && ember cdv emulate ios
  • The simulator was launched but the app showed a blank screen, 'ember cdv:serve' still running in tab1

I hook up the safari browser of my notebook to the app running in simulator, its console tap displaying information "exeption nativeEvalAndFetch : ReferenceError: Can't find variable: cordova global code - index.html:1:127".

Questions

  1. Did I miss any steps?
  2. Was the information telling the reason why the app can't show up in ios simulator?

SyntaxError in platform.js

Trying to serve my app after conversion from ember-cli-cordova to ember-cordova (also changed name to 'mobile.spike' to avoid the dash-constraint raised as separate issue).

SyntaxError: modules/ember-cordova/services/device/platform.js: Line 160: "v" is read-only

    const v = version.toString();
    if (v.indexOf('.') > 0) {
      v = v.replace('.', '_');
    } else {
      v += '_0';
    }

at File.errorWithNode (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/transformation/file/index.js:489:13)
at NodePath.errorWithNode (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/path/index.js:155:26)

at NodePath.Scope (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/transformation/transformers/es6/constants.js:48:25)
at NodePath.<anonymous> (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/visitors.js:221:17)
at NodePath.call (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/path/context.js:56:28)
at NodePath.visit (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/path/context.js:90:8)
at TraversalContext.visitSingle (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/context.js:132:12)
at TraversalContext.visit (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/context.js:148:19)
at Function.traverse.node (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/index.js:76:17)
at NodePath.visit (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli-babel/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/traversal/path/context.js:107:26)

Error installing browser platform

Hi. Encountering this issue when installing browser on a newly inited Ember 2.6 repo.

ember cdv platform add browser
Running 'cordova platform add browser'
Adding browser project...
Running command: /Users/brent/.cordova/lib/npm_cache/cordova-browser/4.1.0/package/bin/create /projects/embercordova/ember-cordova/cordova/platforms/browser cordova cordova
Creating Browser project. Path: platforms/browser
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for browser
Installing "cordova-plugin-whitelist" for ios
Failed to install 'cordova-plugin-whitelist':CordovaError: Could not find *-Info.plist file, or config.xml file.
    at Object.parseProjectFile [as parse] (/projects/embercordova/ember-cordova/cordova/platforms/ios/cordova/lib/projectFile.js:51:15)
    at Api.addPlugin (/projects/embercordova/ember-cordova/cordova/platforms/ios/cordova/Api.js:209:33)
    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:611:6)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at doNTCallback0 (node.js:417:9)
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try adding it again. Error: Could not find *-Info.plist file, or config.xml file.

Likely related to #85 and #86

'ember install ember-cordova' doesn't work

ember install ember-cordova
Installed packages for tooling via npm.
Cannot find module 'splicon/lib/icon-task'
Error: Cannot find module 'splicon/lib/icon-task'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (E:\***\***\node_modules\ember-cordova\lib\commands\mak
e-icons.js:3:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

I am on "ember-cli": "2.5.1"

Addon is missing a dummy app for testing

โžœ ember-cordova git:(master) ember -v
version: 2.3.0
node: 4.0.0
os: darwin x64
โžœ ember-cordova git:(master) node -v
v4.0.0
โžœ ember-cordova git:(master) npm -v
3.8.6
โžœ ember-cordova git:(master)

โžœ  ember-cordova git:(master) ember s
version: 2.3.0
DEPRECATION: this.pickFiles is deprecated, please use broccoli-funnel directly instead  [addon: qunit-bdd]
broccoli-funnel does not support `files:` option with globs, please use `include:` instead
DEPRECATION: this.mergeTrees is deprecated, please use broccoli-merge-trees directly instead  [addon: qunit-bdd]
Attempting to watch missing directory: tests/dummy/app
Error: Attempting to watch missing directory: tests/dummy/app
    at EventEmitter.Watcher_addWatchDir [as addWatchDir] (/Users/flama/Projects/ember-cordova/node_modules/broccoli-sane-watcher/index.js:90:11)
    at /Users/flama/Projects/ember-cordova/node_modules/broccoli/lib/builder.js:94:35
    at lib$rsvp$$internal$$tryCatch (/Users/flama/Projects/ember-cordova/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/flama/Projects/ember-cordova/node_modules/rsvp/dist/rsvp.js:1048:17)
    at /Users/flama/Projects/ember-cordova/node_modules/rsvp/dist/rsvp.js:331:11
    at lib$rsvp$asap$$flush (/Users/flama/Projects/ember-cordova/node_modules/rsvp/dist/rsvp.js:1198:9)
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
Livereload server on http://localhost:49152
Serving on http://localhost:4200/

Problem installing: "App id contains reserved word"

I have a small spike I'd got working with ember-cli-cordova and wanted to switch over to ember-cordova. I did the following:

  • removed ember-cli-cordova from my package.json
  • ran ember install ember-cordova, this resulted in the following error:

2016-03-27_12-49-24

Error seems to originate from the ember-cordova/lib/tasks/bash.js shell script, stack trace is:

Error: Command failed: cordova create cordova mobile-spike mobile-spike
at checkExecSyncError (child_process.js:469:13)
at execSync (child_process.js:509:13)
at /Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cordova/lib/tasks/bash.js:23:7
at lib$rsvp$$internal$$initializePromise (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
at PromiseExt.lib$rsvp$promise$$Promise (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
at new PromiseExt (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli/lib/ext/promise.js:32:8)
at Class.module.exports.Task.extend.run (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cordova/lib/tasks/bash.js:17:12)
at Class.module.exports.Task.extend.run (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cordova/lib/tasks/create-cordova-project.js:30:21)
at Class.module.exports.afterInstall (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cordova/blueprints/ember-cordova/index.js:34:19)
at lib$rsvp$$internal$$tryCatch (/Volumes/PEGASUS/repos/mine/lg2/mobile-spike/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)

Error when running ember cdv platform add android

Followed the instructions, also I have this in my package.json and bower.json:

  "name": "com.company.Name",

but getting this, not sure why:

ember cdv platform add android
Running 'cordova platform add android'
Adding android project...
Error: Error validating package name. Package name must look like: com.company.Name
File: /bin/sh
Command failed: cordova platform add android
Error: Command failed: cordova platform add android
    at checkExecSyncError (child_process.js:469:13)
    at execSync (child_process.js:509:13)
    at /home/user/my-ember-cordova/node_modules/ember-cordova/lib/tasks/bash.js:23:7
    at lib$rsvp$$internal$$initializePromise (/home/user/my-ember-cordova/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
    at PromiseExt.lib$rsvp$promise$$Promise (/home/user/my-ember-cordova/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
    at new PromiseExt (/home/user/my-ember-cordova/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at Class.module.exports.Task.extend.run (/home/user/my-ember-cordova/node_modules/ember-cordova/lib/tasks/bash.js:17:12)
    at Class.module.exports.Task.extend.run (/home/user/my-ember-cordova/node_modules/ember-cordova/lib/tasks/cordova.js:21:8)
    at Class.module.exports.run (/home/user/my-ember-cordova/node_modules/ember-cordova/lib/commands/cordova.js:54:27)
    at Class.module.exports.validateAndRun (/home/user/my-ember-cordova/node_modules/ember-cordova/lib/commands/cordova.js:44:17)

Whitelist plugin validation broken

Commit a58181b renamed a property in tasks/validate-plugin.js:
pluginName => desiredKeyName

This breaks validation in the command serve.js where "pluginName"
is still used to initialize the Validator. (Line 83)

cordova:build does not stop when app build fails

ember cordova:build --platform android

Build failed.
File: language-app/services/audio-player.js
The Broccoli Plugin: [Babel] failed with:
SyntaxError: language-app/services/audio-player.js: Unexpected token (20:37)

  _mediaError(error) {
    console.log(JSON.stringify(error);
  }
});

[...]

Symlinked dist/ to cordova/www

[...]

BUILD SUCCESSFUL

I believe that if application build fails then the dist directory should not be symlinked and Cordova CLI should not be invoked at all. What do you think?

Install error

getting:

Unexpected token )
SyntaxError: Unexpected token )
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.Module._extensions..js (module.js:448:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/projects/NuukTaxiApp/nuuk-mobile/node_modules/ember-cordova/lib/tasks/ember-build.js:5:23)
    at Module._compile (module.js:430:26)
    at Object.Module._extensions..js (module.js:448:10)

when running: ember install ember-cordova

Error installing iOS platform

Hi. Encountering this issue when installing iOS on a newly inited Ember 2.6 repo.

ember cdv platform add ios
Running 'cordova platform add ios'
Adding ios project...
Creating Cordova project for the iOS platform:
    Path: platforms/ios
    Package: cordova
    Name: cordova
iOS project created with [email protected]
Error: ENOENT: no such file or directory, open '/projects/embercordova/ember-cordova/cordova/platforms/ios/cordova/cordova-Info.plist'
File: /bin/sh
Command failed: cordova platform add ios
Error: Command failed: cordova platform add ios
    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at CoreObject.BashTask.runCommand (/projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:28:16)
    at /projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:22:12
    at lib$rsvp$$internal$$initializePromise (/projects/embercordova/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
    at PromiseExt.lib$rsvp$promise$$Promise (/projects/embercordova/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
    at new PromiseExt (/projects/embercordova/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at CoreObject.Task.extend.run (/projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:16:12)
    at CoreObject.module.exports.run (/projects/embercordova/node_modules/ember-cordova/lib/commands/cordova.js:60:8)
    at CoreObject.module.exports.validateAndRun (/projects/embercordova/node_modules/ember-cordova/lib/commands/cordova.js:45:17)

Icon management docs

Migrating from ember-cli-cordova, where I managed the icon myself with cordova-icon, how do I take advantage of the auto generation in ember-cordova?

blank screen on the simulator

blank screen on the simulator
and I see this error

[Error] Failed to load resource: The requested URL was not found on this server. (vendor.css, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (app.css, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (cordova.js, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (vendor.js, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (app.js, line 0)

"ember-cli": "2.6.2",
"ember-data": "^2.6.0",
"ember": "~2.6.0",

Error installing android platform

Hi. Encountering this issue when installing android on a newly inited Ember 2.6 repo.

ember cdv platform add android
Running 'cordova platform add android'
Adding android project...
Error: Error validating package name. Package name must look like: com.company.Name
File: /bin/sh
Command failed: cordova platform add android
Error: Command failed: cordova platform add android
    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at CoreObject.BashTask.runCommand (/projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:28:16)
    at /projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:22:12
    at lib$rsvp$$internal$$initializePromise (/projects/embercordova/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1084:9)
    at PromiseExt.lib$rsvp$promise$$Promise (/projects/embercordova/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:546:53)
    at new PromiseExt (/projects/embercordova/node_modules/ember-cli/lib/ext/promise.js:32:8)
    at CoreObject.Task.extend.run (/projects/embercordova/node_modules/ember-cordova/lib/tasks/bash.js:16:12)
    at CoreObject.module.exports.run (/projects/embercordova/node_modules/ember-cordova/lib/commands/cordova.js:60:8)
    at CoreObject.module.exports.validateAndRun (/projects/embercordova/node_modules/ember-cordova/lib/commands/cordova.js:45:17)

git ignore needed

Right now a ton of built cordova files get added to your repo. ideally, you would leave the platforms folder empty, or leave the platform.json file in there, and then an npm install post step would run the ember cordova add platform's as needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.