Skip to content

Error: Exception: The plugin [email protected] is already installed #2487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
grasshoppermouse opened this issue Feb 3, 2017 · 42 comments
Closed
Assignees
Labels
Milestone

Comments

@grasshoppermouse
Copy link

grasshoppermouse commented Feb 3, 2017

Just updated to 2.5. I can add the ios platform and run on the emulator, but I can't add the android platform (OS X 10.12.2).

UPDATE: when I create a new test project, tns run android works. But I still can't add the android platform to my existing project. Pointers appreciated.

van-aimc-l2dnmp:aapa-conference-app hagen$ node --version
v7.5.0
van-aimc-l2dnmp:aapa-conference-app hagen$ npm --version
4.1.2
van-aimc-l2dnmp:aapa-conference-app hagen$ tns --version
2.5.0
van-aimc-l2dnmp:aapa-conference-app hagen$ tns doctor
Verifying CocoaPods. This may take more than a minute, please be patient.
  ◝ Installing iOS [email protected] /private/var/folders/6p/vb6bmpxd65v_hpd91kzj3jhh0000gq/T/nativescript-check-cocoapods11713-24129-lbxqsa.djp4vrhpvi
└── [email protected] 


  ◜ Verifying CocoaPods. This may take some time, please be patient..
Your components are up-to-date.

No issues were detected.
van-aimc-l2dnmp:aapa-conference-app hagen$ npm uninstall tns-android
- [email protected] node_modules/tns-android
van-aimc-l2dnmp:aapa-conference-app hagen$ npm cache clean
van-aimc-l2dnmp:aapa-conference-app hagen$ tns platform add android --log trace
execFile: /usr/local/opt/android-sdk/platform-tools/adb "help"
execFile: /usr/local/opt/android-sdk/platform-tools/adb "help"
spawn: /usr/local/opt/android-sdk/platform-tools/adb "--help"
Socket {
  connecting: false,
  _hadError: false,
  _handle: 
   Pipe {
     bytesRead: 0,
     _externalStream: {},
     fd: 15,
     writeQueueSize: 0,
     owner: [Circular],
     onread: [Function: onread],
     reading: true },
  _parent: null,
  _host: null,
  _readableState: 
   ReadableState {
     objectMode: false,
     highWaterMark: 16384,
     buffer: BufferList { head: null, tail: null, length: 0 },
     length: 0,
     pipes: null,
     pipesCount: 0,
     flowing: null,
     ended: false,
     endEmitted: false,
     reading: true,
     sync: false,
     needReadable: true,
     emittedReadable: false,
     readableListening: false,
     resumeScheduled: false,
     defaultEncoding: 'utf8',
     ranOut: false,
     awaitDrain: 0,
     readingMore: false,
     decoder: null,
     encoding: null },
  readable: true,
  domain: null,
  _events: 
   { end: { [Function: bound onceWrapper] listener: [Function: onend] },
     finish: [Function: onSocketFinish],
     _socketEnd: [Function: onSocketEnd],
     close: [Function] },
  _eventsCount: 4,
  _maxListeners: undefined,
  _writableState: 
   WritableState {
     objectMode: false,
     highWaterMark: 16384,
     needDrain: false,
     ending: false,
     ended: false,
     finished: false,
     decodeStrings: false,
     defaultEncoding: 'utf8',
     length: 0,
     writing: false,
     corked: 0,
     sync: true,
     bufferProcessing: false,
     onwrite: [Function: bound onwrite],
     writecb: null,
     writelen: 0,
     bufferedRequest: null,
     lastBufferedRequest: null,
     pendingcb: 0,
     prefinished: false,
     errorEmitted: false,
     bufferedRequestCount: 0,
     corkedRequestsFree: 
      CorkedRequest {
        next: null,
        entry: null,
        finish: [Function: bound onCorkedFinish] } },
  writable: false,
  allowHalfOpen: false,
  destroyed: false,
  _bytesDispatched: 0,
  _sockname: null,
  _pendingData: null,
  _pendingEncoding: '',
  server: null,
  _server: null }
Exec uname -a 
 stdout: Darwin van-aimc-l2dnmp.vancouver.wsu.edu 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64
 
 stderr: 
Exec npm -v 
 stdout: 4.1.2
 
 stderr: 
spawn: java "-version"
Exec node-gyp -v 
 stdout:  
 stderr: /bin/sh: node-gyp: command not found

Exec xcodebuild -version 
 stdout: Xcode 8.1
Build version 8B62
 
 stderr: 
Exec gem which xcodeproj 
 stdout: /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.2/lib/xcodeproj.rb
 
 stderr: 
Exec pod --version 
 stdout: 1.2.0
 
 stderr: 
Exec '/usr/local/opt/android-sdk/platform-tools/adb' version 
 stdout: Android Debug Bridge version 1.0.36
Revision 0e9850346394-android
 
 stderr: 
spawn: /usr/local/opt/android-sdk/tools/android "-h"
Result when throw error is false:
{ stdout: '\n       Usage:\n       android [global options] action [action options]\n       Global options:\n  -s --silent     : Silent mode, shows errors only.\n  -v --verbose    : Verbose mode, shows errors, warnings and all messages.\n     --clear-cache: Clear the SDK Manager repository manifest cache.\n  -h --help       : Help on a specific command.\n\n                                                                    Valid\n                                                                    actions\n                                                                    are\n                                                                    composed\n                                                                    of a verb\n                                                                    and an\n                                                                    optional\n                                                                    direct\n                                                                    object:\n-    sdk              : Displays the SDK Manager window.\n-    avd              : Displays the AVD Manager window.\n-   list              : Lists existing targets or virtual devices.\n-   list avd          : Lists existing Android Virtual Devices.\n-   list target       : Lists existing targets.\n-   list device       : Lists existing devices.\n-   list sdk          : Lists remote SDK repository.\n- create avd          : Creates a new Android Virtual Device.\n-   move avd          : Moves or renames an Android Virtual Device.\n- delete avd          : Deletes an Android Virtual Device.\n- update avd          : Updates an Android Virtual Device to match the folders\n                        of a new SDK.\n- create project      : Creates a new Android project.\n- update project      : Updates an Android project (must already have an\n                        AndroidManifest.xml).\n- create test-project : Creates a new Android project for a test package.\n- update test-project : Updates the Android project for a test package (must\n                        already have an AndroidManifest.xml).\n- create lib-project  : Creates a new Android library project.\n- update lib-project  : Updates an Android library project (must already have\n                        an AndroidManifest.xml).\n- create uitest-project: Creates a new UI test project.\n- update adb          : Updates adb to support the USB devices declared in the\n                        SDK add-ons.\n- update sdk          : Updates the SDK by suggesting new platforms to install\n                        if available.\n',
  stderr: '',
  exitCode: 1 }
Exec mono --version 
 stdout:  
 stderr: /bin/sh: mono: command not found

Exec git --version 
 stdout: git version 2.9.3 (Apple Git-75)
 
 stderr: 
Exec gradle -v 
 stdout:  
 stderr: /bin/sh: gradle: command not found

Exec "/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javac" -version 
 stdout:  
 stderr: javac 1.8.0_101

System information:
{ procInfo: 'nativescript/2.5.0',
  platform: 'darwin',
  os: 'Darwin van-aimc-l2dnmp.vancouver.wsu.edu 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64\n',
  shell: '/bin/bash',
  dotNetVer: null,
  procArch: 'x64',
  nodeVer: 'v7.5.0',
  npmVer: '4.1.2',
  javaVer: '1.8.0',
  nodeGypVer: null,
  xcodeVer: 'Xcode 8.1\nBuild version 8B62\n',
  xcodeprojGemLocation: '/Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.2/lib/xcodeproj.rb\n',
  itunesInstalled: true,
  cocoapodVer: '1.2.0',
  adbVer: 'Android Debug Bridge version 1.0.36',
  androidInstalled: true,
  monoVer: null,
  gitVer: '2.9.3 (Apple Git-75)',
  gradleVer: null,
  javacVersion: '1.8.0_101' }
Initializing analytics statuses.
Analytics statuses: 
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'platform'.
Looking for project in '/Users/hagen/Documents/Websites/AAPA/aapa-conference-app'
Project directory is '/Users/hagen/Documents/Websites/AAPA/aapa-conference-app'.
Analytics statuses: 
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'platform|add'.
Creating NativeScript project for the android platform
Path: /Users/hagen/Documents/Websites/AAPA/aapa-conference-app/platforms/android
Package: org.nativescript.aapaconferenceapp
Name: aapaconferenceapp
Copying template files...
  ◝ Installing tns-androidExec npm view tns-android --json  dist-tags 
 stdout: {
  "latest": "2.5.0",
  "next": "2.6.0-next-2017-02-01-1648"
}
 
 stderr: 
Using version 2.5.0. 
Installing  tns-android
spawn: npm "install" "[email protected]" "--silent" "--save"
  ◡ Installing tns-android/Users/hagen/Documents/Websites/AAPA/aapa-conference-app
└── [email protected] 


The plugin [email protected] is already installed
{ Error: The plugin [email protected] is already installed
    at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:107:28)
    at Errors.failWithoutHelp (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:115:14)
    at /usr/local/lib/node_modules/nativescript/lib/node-package-manager.js:63:30
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:111:75
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:92:106
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
  name: 'Exception',
  message: 'The plugin [email protected] is already installed',
  stack: 'Error: The plugin [email protected] is already installed\n    at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:107:28)\n    at Errors.failWithoutHelp (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:115:14)\n    at /usr/local/lib/node_modules/nativescript/lib/node-package-manager.js:63:30\n    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)\n    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)\n    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:111:75\n    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)\n    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)\n    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:92:106\n    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)',
  errorCode: 127,
  suppressCommandHelp: true,
  futureStack: 'Error: The plugin [email protected] is already installed\n    at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:107:28)\n    at Errors.failWithoutHelp (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:115:14)\n    at /usr/local/lib/node_modules/nativescript/lib/node-package-manager.js:63:30\n    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)\n    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)\n    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:111:75\n    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)\n    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)\n    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:92:106\n    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)' }
%s. Error: %s
Error: Failed to retrieve data from npm. Please try again a little bit later.. Error: Exception: The plugin [email protected] is already installed
    at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:107:28)
    at /usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:47:30
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
    at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:85:142
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
    at _.each.platform (/usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:53:58)
    at arrayEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:451:11)
    at Function.forEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:8634:14)
Analytics statuses: 
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'help'.
List of registered commands: /?, appstore, appstore|upload, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, clean-app, clean-app|android, clean-app|ios, create, debug, debug|android, debug|ios, deploy, dev-generate-help, dev-generate-messages, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, devices, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, emulate, emulate|android, emulate|ios, error-reporting, help, info, init, install, livesync, platform, platform|*list, platform|add, platform|clean, platform|remove, platform|update, plugin, plugin|add, plugin|find, plugin|install, plugin|remove, plugin|search, plugin|update, post-install-cli, prepare, publish, publish|ios, run, run|android, run|ios, test, test|android, test|init, test|ios, update, usage-reporting
Reading help for command 'platform|add'. FileName is 'platform-add.md'.
# platform add

┌──────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Usage                    │ Synopsis                                                                                                                                        │
│ Android latest runtime   │ $ tns platform add android [--framework-path <File Path>] [--symlink] [--sdk <API Level>] [--platform-template <Platform Template>]             │
│ Android selected runtime │ $ tns platform add android[@<Version>] [--framework-path <File Path>] [--symlink] [--sdk <API Level>] [--platform-template <Platform Template>] │
│ iOS latest runtime       │ $ tns platform add ios [--framework-path <File Path>] [--symlink]                                                                               │
│ iOS selected runtime     │ $ tns platform add ios[@<Version>] [--framework-path <File Path>] [--symlink] [--platform-template <Platform Template>]                         │
└──────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Configures the current project to target the selected platform. 

### Options

    * --framework-path - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If --symlink is specified, <File Path> must point to directory in which the runtime is already extracted. If --symlink is not specified, <File Path> must point to a valid npm package.
    * --symlink - Creates a symlink to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If --frameworkPath is specified, creates a symlink to the specified directory. If --frameworkPath is not specified, creates a symlink to platform runtime installed with your current version of NativeScript.
    * --sdk - Sets the target Android SDK for the project.
    * --platform-template - Sets the platform template that will be used for the native application.

### Attributes

    * <API Level> is a valid Android API level. For example: 17, 19, MNC.
    * <File Path> is the complete path to a valid npm package or a directory that contains a NativeScript runtime for the selected platform.
    * <Platform Template> is a valid npm package, path to directory, .tgz or GitHub URL that contains a native Android or iOS template.
    * <Version> is any available version of the respective platform runtime published in npm. 

Analytics statuses: 
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track exception with message 'Failed to retrieve data from npm. Please try again a little bit later.. Error: Exception: The plugin [email protected] is already installed'.
@DavidKk
Copy link

DavidKk commented Feb 4, 2017

me2

@buzzgamesnews
Copy link

yes me 2. please fix it
image

@petekanev
Copy link
Contributor

It is a known issue that occurs sometimes, and is a bit annoying.

To fix it you need to edit your package.json's content and remove the tns-android dependency under "dependencies: { }", as well as the android entry from the "nativescript: { }" key if one was also written there. Then clear the npm cache npm cache clear and proceed with installing the platform again - tns platform add android

@buzzgamesnews
Copy link

thanks. works fine

@randy-johnson
Copy link

I think it showed up for me in the package json after running the following line:

npm install tns-core-modules@latest --save

from http://docs.nativescript.org/releases/upgrade-instructions

but not 100% sure.

@minato-namikaze
Copy link

Hi.
It's still not working for me.

  • Platform: Windows
  • ANDROID_HOME=C:\Users<USER>\AppData\Local\Android\android-sdk\platforms\android-22
  • Platform version=Android 22
  • Android support repository installed as well

I followed all the steps mentioned above without success.

Any other solution ?

@petekanev
Copy link
Contributor

@minato-namikaze please describe the error in details and how it can be reproduced. Also the Android SDK path doesn't seem correct. At all. it should go as far as \android-sdk\.

Check the existing issue to find out whether yours has been encountered by other people.

@votiakov
Copy link

votiakov commented Feb 6, 2017

Following the steps from http://docs.nativescript.org/angular/releases/upgrade-instructions.html adds tns-android to "dependencies" section of package.json file.

Then if I execute tns platform add android I get the following error The plugin [email protected] is already installed.

So I try to do tns platform remove android and get this error: The platform android is not added to this project. Please use 'tns platform add <platform>'

Then I remove "tns-android" entry from "dependencies" manually, clear npm cache, and do tns platform add android again - and again it adds "tns-android" to the "dependencies" section.

If I repeat the cleaning steps and remove platforms folders and then exec tns update - all the same. "tns-ios" is installed normally and "tns-android" is again in "dependencies".

@Shashidharbu
Copy link

@Pip3r4o
its not working for me

@petekanev
Copy link
Contributor

@votiakov currently tns platform add android will add it as a saved dependency for just a moment, before it removes it. I can confirm that it shouldn't remain as a dependency once it's installed. We'll look into it

@minato-namikaze
Copy link

  1. Check the ANDROID_HOME is ok
  2. Install the API 22 + ion the Extras > Android Support Repository
  3. Run the following
    tns platform remove android tns platform add android@next
  4. Run
    tns run android

@votiakov
Copy link

votiakov commented Feb 6, 2017

Thanks for support, that was my fault.

I have 2 directories with android SDKs and I installed 25.0.2 to the wrong directory. So tns platform add could not properly install the platform, that is why tns-android was still in the dependencies section, because the installation of platform fails. Probably you should also remove the tns-android from the dependencies section if the installation is not successful?

@petekanev
Copy link
Contributor

@votiakov We should indeed!

@minato-namikaze it still doesn't become clear whether your ANDROID_HOME points to the correct directory now, You should probably install API 23 and above too, as well as the other support libraries. Build tools 25.0.2 are also required. I'd suggest installing the current platform [email protected] as it's the current stable, and some commits in @next can sometimes make the platform unstable until release.

I also want to kindly ask you to provide an error report or anything that can help us to identify the problem. Simply stating that you have a problem without additional information is of no use, and we can't identify the culprit.

@petekanev petekanev added the bug label Feb 6, 2017
@grasshoppermouse
Copy link
Author

grasshoppermouse commented Feb 6, 2017

I'm not at work yet, so I can't double check everything, but before I filed this I had removed the tns-android dependency from package.json and cleared the npm cache, as recommended. There was no android entry in the nativescript key in package.json. I will check for multiple installs of the android SDK when I get to work. What else should I check? I was able to add the android platform to a fresh test project. Thanks.

Here is my package.json:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.aapaconferenceapp",
    "tns-ios": {
      "version": "2.5.0"
    }
  },
  "dependencies": {
    "@angular/common": "2.1.0",
    "@angular/compiler": "2.1.0",
    "@angular/core": "2.1.0",
    "@angular/forms": "2.1.0",
    "@angular/http": "2.1.0",
    "@angular/platform-browser": "2.1.0",
    "@angular/platform-browser-dynamic": "2.1.0",
    "@angular/router": "3.1.0",
    "angular": "^1.5.8",
    "elasticlunr": "^0.9.5",
    "nativescript-angular": "1.1.0",
    "nativescript-calendar": "^1.2.0",
    "nativescript-email": "^1.3.4",
    "nativescript-social-share": "^1.3.1",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tns-core-modules": "^2.5.0"
  },
  "devDependencies": {
    "babel-traverse": "6.18.0",
    "babel-types": "6.18.0",
    "babylon": "6.13.1",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.3.2",
    "typescript": "^2.0.3",
    "zone.js": "~0.6.21"
  }
}

@votiakov
Copy link

votiakov commented Feb 6, 2017

@grasshoppermouse I would check if your /usr/local/opt/android-sdk/ directory has build-tools 25.0.2 .

@grasshoppermouse
Copy link
Author

Thanks. @votiakov, yes, I have 25.0.2.

Following recommendations here I can now add the android platform, and it installs on my device (Moto G, Android 4.4.4), but after displaying the splash screen it then crashes with:

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4412)
	at android.app.ActivityThread.access$1500(ActivityThread.java:139)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:136)
	at android.app.ActivityThread.main(ActivityThread.java:5086)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
	at dalvik.system.NativeStart.main(Native Method)
Caused by: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
	at com.tns.Module.bootstrapApp(Module.java:341)
	at com.tns.Runtime.run(Runtime.java:573)
	at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1030)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4409)
	... 10 more
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
	at com.tns.Module.resolvePathHelper(Module.java:159)
	at com.tns.Module.bootstrapApp(Module.java:339)
	... 14 more

@grasshoppermouse
Copy link
Author

Some change I made debugging the original problem caused the second problem. Fixed now.

@x00
Copy link

x00 commented Feb 11, 2017

I did npm cache clear
removed the reference to the android in package.json
then tns platform update android rather that remove then install, then tns update

@allberto
Copy link

allberto commented Mar 3, 2017

Hi ! I have the same problem and I do what you suggest, I delete from package.json the tns-android but when I tried to add android platform it throws me

sed: invalid replacement string

Do you have any idea for this?

Thanks a lot !

@Svoig
Copy link

Svoig commented Mar 3, 2017

I'm running into this as well. iOS builds fine, but building Android results in:

Exception: The plugin [email protected] is already installed

Some previous answers mention removing the tns-android entry from the package.json "dependencies" block. This worked for me a few weeks ago, but now there is no tns-android entry in that block. It only appears under "nativescript", and removing it seems to have no effect.

Additionally, running tns update in the project gives me a helpful Could not update the project! error.

Any insight would be appreciated.

EDIT: Cleaning out the project and re-npm install-ing fixed my problem.

@shivapersad
Copy link

I'm having the same issue as @allberto. When I attempt to add the android platform it gives me the error "sed: invalid replacement string" and fails out.

@irman
Copy link

irman commented Mar 9, 2017

Are there no fix for this yet?

@petekanev petekanev removed their assignment Mar 9, 2017
@Plamen5kov
Copy link
Contributor

@irman, @Svoig, @shivapersad, @allberto please provide us with steps to reproduce along with the version of CLI and what OS you're on?

@minato-namikaze you should probably run tns doctor to check if your environment is set up correctly.

@irman
Copy link

irman commented Mar 9, 2017

This is my package.json:

{
  "description": "MYAPPNAME",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.myapp"
  },
  "dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/router": "3.2.1",
    "@irman/nativescript-ng2-slides": "^0.1.0",
    "@irman/nativescript-screen-orientation": "^1.0.2",
    "nativescript-angular": "^1.3.0",
    "nativescript-angular-snapshot": "1.4.1-5.5.372.32",
    "nativescript-drop-down": "^1.5.1",
    "nativescript-fresco": "^1.0.16",
    "nativescript-hook-debug-production": "^1.0.3",
    "nativescript-iqkeyboardmanager": "^1.0.1",
    "nativescript-master-technology": "^1.0.9",
    "nativescript-onesignal": "^1.0.6",
    "nativescript-secure-storage": "^2.1.0",
    "nativescript-telerik-ui": "^1.5.1",
    "nativescript-theme-core": "^0.2.6",
    "nativescript-timedatepicker": "^1.1.0",
    "nativescript-toast": "^1.4.5",
    "nativescript-webview-interface": "^1.4.1",
    "reflect-metadata": "~0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tns-core-modules": "^2.5.1"
  },
  "devDependencies": {
    "babel-traverse": "6.19.0",
    "babel-types": "6.19.0",
    "babylon": "6.14.1",
    "gulp": "^3.9.1",
    "gulp-options": "^1.1.1",
    "lazy": "1.0.11",
    "merge": "^1.2.0",
    "nativescript-dev-sass": "^0.4.1",
    "nativescript-dev-typescript": "^0.3.2",
    "plist": "^2.0.1",
    "typescript": "^2.1.4",
    "xml2js": "^0.4.17",
    "yargs": "^6.6.0",
    "zone.js": "~0.6.21"
  }
}

But every time I run tns run android or adding them manually tns platform add android after removing them, it always add "tns-android": "^2.5.0", back to the dependecies on package.json. And then the error occured:

image

Environment tested:

  • tns: 2.5.2
  • Windows 10 & OS X El Capitan

It seems to suddenly happened today right after I run tns update, and I usually run it everyday each time before publishing.

@Plamen5kov
Copy link
Contributor

@irman the problem is the nativescript id: currently needs at least 3 components:
a.b.C: it's a mistake on our part, but we'll fix it ASAP. You can temporary workaround your issue by adding one more namespace to the nativescript id. E.g
com.myapp.A

@irman
Copy link

irman commented Mar 9, 2017

@Plamen5kov oh wow really? thank you! it works now, although I need to update my app id now. 🤔

@irman
Copy link

irman commented Mar 9, 2017

@Plamen5kov Is there any workaround to change the APP ID manually without waiting for the fix? I have published version with the app ID on iOS already, don't want them to be different.

@Plamen5kov
Copy link
Contributor

Plamen5kov commented Mar 9, 2017

@irman I'll do a fix shortly that will take the last parameter as an ID, would that work for you? The fix will be accessable through installing CLI like so:
npm install -g nativescript@next

Edit: If you don't want to use the id set in the package.json, you can set an explicit one in app/App_Resources/Android/app.gradle in applicationId.

@irman
Copy link

irman commented Mar 9, 2017

@Plamen5kov yea that'd be great! note that I have a gulp that run to set app id (and app version and other stuffs) on several locations:

  • app.gradle
  • Info.plist
  • package.json

based on my own config.json. I don't think it would affect the thing you're going to do. But just in case. This is like my own version of environment config.

@Plamen5kov
Copy link
Contributor

@irman you can read more information here but in short:

However, the application ID and package name are independent of each other beyond this point. You can change your code's package name (your code namespace) and it will not affect the application ID, and vice versa (though, again, you should not change your application ID once you publish your app). However, changing the package name has other consequences you should be aware of, so see the section ....

The applicationid in app.gradle is responsible for the name in google play store, while the package.name set in package.json and later replaced in AndroidManifest.xml is responsible for the name on the device.
Our default behavior keeps both id's the same, but there's no problem in changing them separately.

@irman
Copy link

irman commented Mar 9, 2017

Does this mean that I can set the id as A.B.C for now in package.json but leave the app.gradle & image in AndroidManifest.xml to the one I want (A.B)? OK.

But it looks like more trouble now. Especially for you. I should just rename the app id so instead of these:

  • com.myapp
  • com.myapp.dev
  • com.myapp.staging

I'll have these instead:

  • com.myapp.production
  • com.myapp.dev
  • com.myapp.staging

Just found out need to resubmit the app for review (iOS) if I want to update it anyway, might as well create a new APP ID. What do you think? @Plamen5kov

@Plamen5kov
Copy link
Contributor

@irman whatever works best for you. I sent you what are the recommended workflows suggested by google so you can choose what best fits you.

@shivapersad
Copy link

shivapersad commented Mar 9, 2017

@Plamen5kov I was able to resolve the issue. I had my "id" as "com.something" when it should be 3 i.e. "org.company.application". This affected the Android build only. Sorry for not responding earlier.

@Plamen5kov Plamen5kov self-assigned this Mar 9, 2017
@Plamen5kov
Copy link
Contributor

Plamen5kov commented Mar 9, 2017

In case of anymore troubles with adding the platform, when an unexpected crash happens or you just interrupt the command with ctrl + c just do the following steps:

  • npm uninstall tns-android --save
  • delete platforms/android folder

You can test with CLI from master by installing it like so:
npm install -g nativescript@next

  • redo command tns platform add android

@sagearbor
Copy link

I just tried to start a project from scratch cloning the nativescript-template-tutorial, and then got the error immediately upon trying to update to 2.5.2. The lines below should reproduce. ideas?

tns create testFail --template nativescript-template-tutorial
cd testFail
tns --version
tns update
tns --version
tns update 2.5.2
ABOVE GETS ERROR "Could not update project!"
tns --version
STILL 2.5.0

@irman
Copy link

irman commented Mar 10, 2017

Thanks everyone! @Plamen5kov when do you expect this to be resolved? So that I can be aware for the other project we're working on.

@Plamen5kov
Copy link
Contributor

@irman can you be more specific, there are 3 issues here.

@Plamen5kov
Copy link
Contributor

@sagearbor try running:
tns update 2.5, this will update your basic components as much as possible to version 2.5, but if you want the latest bits just run tns update.

@irman
Copy link

irman commented Mar 10, 2017

@Plamen5kov
This one:
image

@Plamen5kov
Copy link
Contributor

Plamen5kov commented Mar 10, 2017

@irman I forgot to relate the PR to the issue. Thank you for reminding me.
On your question, it will be fixed in 3.0, but you can get it earlier in master, as soon as the PR's merged to master.

@zakdances
Copy link

zakdances commented Mar 22, 2017

Still having this problem. And tns update has never worked for me - it always comes back with Could not update the project!

Does anyone know the different between the package.json in the root directory and the package.json in root/app?

@Plamen5kov
Copy link
Contributor

@zakdances as a workaround for update try running:
tns update 3.0.0 or tns update next.

On your second question, the package.json situated in <app_name>/app/ is the javascript template package.json which is used solely for the npm distribution of the template package.
The package.json you want to be using is the one situated in the root directory: <app_name>/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests