MobileChromeApps / mobile-chrome-apps

Chrome apps on Android and iOS
BSD 3-Clause "New" or "Revised" License
2.5k stars 348 forks source link

cca prepare failing at first hurdle (cordova-plugin-background-app) #595

Closed g105b closed 11 months ago

g105b commented 8 years ago

After using cca create, I now change directories to the deployment and type cca prepare. Here is the output:

cca prepare
cca v0.6.0
## First-time build. Detecting available SDKs:
Android Development: SDK configured properly.
## Running Cordova Command: platform add android
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: com.your.company.AppName
    Name: AppName
    Activity: MainActivity
    Android target: android-21
Copying template files...
Android project created with cordova-android@4.0.0-dev
## Updating plugins based on manifest.json
## Running Cordova Command: plugin add cordova-plugin-background-app cordova-plugin-blob-constructor-polyfill cordova-plugin-chrome-apps-bootstrap cordova-plugin-chrome-apps-common cordova-plugin-chrome-apps-i18n cordova-plugin-chrome-apps-navigation cordova-plugin-chrome-apps-runtime cordova-plugin-chrome-apps-storage cordova-plugin-crosswalk-webview cordova-plugin-customevent-polyfill cordova-plugin-file cordova-plugin-inappbrowser cordova-plugin-network-information cordova-plugin-statusbar cordova-plugin-whitelist@1.0.0 cordova-plugin-xhr-blob-polyfill org.chromium.cca-hooks
npm http GET http://registry.cordova.io/cordova-plugin-background-app
npm http 404 http://registry.cordova.io/cordova-plugin-background-app
/home/g105b/.nvm/versions/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/lockfile/lockfile.js:46
      throw er
            ^
Error: 404 Not Found: cordova-plugin-background-app
    at RegClient.<anonymous> (/home/g105b/.nvm/versions/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:268:14)
    at Request.self.callback (/home/g105b/.nvm/versions/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:148:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/home/g105b/.nvm/versions/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:876:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/home/g105b/.nvm/versions/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:827:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

FYI, here is the app's manifest.json:

{
  "manifest_version": 2,
  "name": "AppName",
  "version": "1",

  "icons": {
    "128": "icon-128.png"
  },

  "permissions": [
    "http://example-url-that-needs-loading/*"
  ],

  "app": {
    "background": {
      "scripts": ["cca-runtime.js"]
    }
  },

  "minimum_chrome_version": "40"
}
g105b commented 8 years ago

I moved to Apple Macintosh to deploy to iOS instead, assuming my PC targeting Android was set up incorrectly... same issue on Apple.

Here's the output of cca prepare:

Gregs-MacBook-Air:cca-deploy g105b$ cca prepare
cca v0.6.0
## First-time build. Detecting available SDKs:
Android Development: JDK not found. Failed to run: /usr/libexec/java_home
iOS Development: SDK configured properly.
## Running Cordova Command: platform add ios
iOS project created with cordova-ios@3.8.0
## Updating plugins based on manifest.json
## Running Cordova Command: plugin add cordova-plugin-background-app cordova-plugin-blob-constructor-polyfill cordova-plugin-chrome-apps-bootstrap cordova-plugin-chrome-apps-common cordova-plugin-chrome-apps-i18n cordova-plugin-chrome-apps-navigation cordova-plugin-chrome-apps-runtime cordova-plugin-chrome-apps-storage cordova-plugin-crosswalk-webview cordova-plugin-customevent-polyfill cordova-plugin-file cordova-plugin-inappbrowser cordova-plugin-network-information cordova-plugin-statusbar cordova-plugin-whitelist@1.0.0 cordova-plugin-xhr-blob-polyfill org.chromium.cca-hooks
npm http GET http://registry.cordova.io/cordova-plugin-background-app
npm http 404 http://registry.cordova.io/cordova-plugin-background-app
/Users/g105b/.nvm/versions/node/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/lockfile/lockfile.js:46
      throw er
            ^
Error: 404 Not Found: cordova-plugin-background-app
    at RegClient.<anonymous> (/Users/g105b/.nvm/versions/node/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:268:14)
    at Request.self.callback (/Users/g105b/.nvm/versions/node/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:148:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/Users/g105b/.nvm/versions/node/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:876:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/Users/g105b/.nvm/versions/node/v0.12.7/lib/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:827:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
Gregs-MacBook-Air:cca-deploy g105b$ 
g105b commented 8 years ago

FYI, I have this same issue when trying to do cca prepare on the helloworld example found in https://github.com/MobileChromeApps/mobile-chrome-app-samples.

Here is what I did to break things:

git clone git@github.com:MobileChromeApps/mobile-chrome-app-samples.git
cd mobile-chrome-app-samples/
cca create cca-deploy --link-to=helloworld/manifest.json
cd cca-deploy
cca prepare
agrieve commented 8 years ago

Looks like you're running cca v0.6.0. Can you try updating to the latest (v0.7.4) and try again?

g105b commented 11 months ago

I haven't been able to find a version > 0.6.0 yet and it's been a while. Have a nice day.