Skip to content

Unable to work with devices with numeric identifiers #3832

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
tsonevn opened this issue Aug 22, 2018 · 9 comments
Closed

Unable to work with devices with numeric identifiers #3832

tsonevn opened this issue Aug 22, 2018 · 9 comments
Assignees
Milestone

Comments

@tsonevn
Copy link
Contributor

tsonevn commented Aug 22, 2018

From @felipebueno on August 21, 2018 20:10

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes.

Tell us about the problem

Unable to debug after upgrading to TNS 4.2.2.

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.2
  • Cross-platform modules: 4.2.0
  • Runtime(s): 4.2.0
  • Plugin(s):
    "@nstudio/nativescript-camera-plus": "^1.0.5",
    "email-validator": "^2.0.4",
    "nativescript-camera": "4.0.2",
    "nativescript-checkbox": "^3.0.3",
    "nativescript-couchbase": "^1.0.18",
    "nativescript-downloadmanager": "^0.1.0",
    "nativescript-drop-down": "^3.2.4",
    "nativescript-filterable-listpicker": "git+ssh://[email protected]/innovareti/nativescript-filterable-listpicker.git",
    "nativescript-fresco": "^3.0.6",
    "nativescript-imagepicker": "^5.0.2",
    "nativescript-intl": "^3.0.0",
    "nativescript-pdf-view": "^2.0.1",
    "nativescript-phone": "^1.3.1",
    "nativescript-plugin-firebase": "5.2.0",
    "nativescript-pro-ui": "^3.4.1",
    "nativescript-radio": "^0.3.6",
    "nativescript-slides": "^2.2.14",
    "nativescript-social-share": "^1.5.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-youtubeplayer": "2.2.5",
    "rxjs": "^5.5.6",
    "tns-core-modules": "^4.2.0"

Please tell us how to recreate the issue in as much detail as possible.

I don't know how to recreate the issue.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Log

➜  emulzint-mobile git:(master) ✗ tns run --debug
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Executing before-watchPatterns hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-watchPatterns/nativescript-dev-sass.js
Executing before-watchPatterns hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-watchPatterns/nativescript-dev-typescript.js
Executing before-watchPatterns hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-watchPatterns/nativescript-dev-webpack.js
Executing before-watch hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-watch/nativescript-dev-sass.js
Found peer node-sass
Executing before-watch hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.7.2
Executing before-watch hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-watch/nativescript-dev-webpack.js
Executing before-shouldPrepare hook from /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Skipping prepare.
Refreshing application...
Error while trying to start application br.com.innovareti.emulzintevoce on device 0034008422. Error is: Devices.NotFoundDeviceByIndexErrorMessage 34008421 tns
Unable to start application br.com.innovareti.emulzintevoce on device 0034008422. Try starting it manually.

Copied from original issue: NativeScript/NativeScript#6205

@tsonevn
Copy link
Contributor Author

tsonevn commented Aug 22, 2018

Hi @felipebueno,
Try to clear up the project with the following steps:

  1. delete node_modules, platforms and hooks folders
  2. delete package-lock.json file
  3. remove the project from the device
  4. rebuild the project via tns run android or tns debug android

If the issue persists, please build the project with tns run android --log trace > log.txt and send us the log.txt file.

I also noticed from the provided log that the app is installed properly, however, the CLI was unable to start it. Regarding that, when the following message is printed on the console
-> Error while trying to start application br.com.innovareti.emulzintevoce on device 0034008422. Error is: Devices.NotFoundDeviceByIndexErrorMessage 34008421 tns Unable to start application br.com.innovareti.emulzintevoce on device 0034008422. Try starting it manually.
you can try starting the app manually.

@felipebueno
Copy link

felipebueno commented Aug 22, 2018

Hi, @tsonevn. Thanks for the quick reply.

As you said, I can start the app manually but the problem is that I can't debug the app. And I have a lot of problems to debug after upgrading from 3.4.1 to 4.2 😄

I tried all the steps you suggested but the issue persists.

Complete log is here

Reference:

Error while trying to start application br.com.innovareti.emulzintevoce on device 988919465753515945. Error is: Devices.NotFoundDeviceByIndexErrorMessage 988919465753515900 tns
Unable to start application br.com.innovareti.emulzintevoce on device 988919465753515945. Try starting it manually.
Successfully synced application br.com.innovareti.emulzintevoce on device 988919465753515945.
Project dir from hooksArgs is: /home/felipe/devel/projects/innovare/emulzint/emulzint-mobile.
Hooks directories: [ '/home/felipe/.npm-global/lib/node_modules/nativescript/lib/hooks',
  '/home/felipe/.npm-global/lib/node_modules/nativescript/lib/common/hooks',
  '/home/felipe/devel/projects/innovare/emulzint/emulzint-mobile/hooks' ]
AfterHookName for command liveSync is after-liveSync

@NickIliev
Copy link
Contributor

@felipebueno what is your debug environment (VSCode or Chrome)? If yusing VSCode for debugging then try updating the VSCode extension to the latest and rerun your debug command.

Also, let us know on what device you are trying to debug - is ti emulator or real device and what is the API level?

@dpfavand
Copy link

I'm also experiencing this issue trying to run a project with tns run android. Following the instructions above to clear up the project does not help. One thing I've noticed: in the console output line for the error,

Error while trying to start application br.com.innovareti.emulzintevoce on device 0034008422. Error is: Devices.NotFoundDeviceByIndexErrorMessage 34008421 tns

the second device ID is off by one. It looks like the device ID is being treated like an index and some code is doing i - 1.

When trying to connect to a running project, as suggested above, I receive the same error:

> tns debug android --start
Searching for devices...
device: 18020523021095 debug port: 40000

Devices.NotFoundDeviceByIndexErrorMessage 18020523021094 tns

...(tns debug android help screen)...

tns --version is 4.2.3. Hooks, platforms, node_modules and package_lock.json were cleared before running tns run android. package.json is as follows:

  "dependencies": {
    "@angular/animations": "~6.1.0",
    "@angular/cli": "^6.0.8",
    "@angular/common": "~6.1.0",
    "@angular/compiler": "~6.1.0",
    "@angular/core": "~6.1.0",
    "@angular/forms": "~6.1.0",
    "@angular/http": "~6.1.0",
    "@angular/platform-browser": "~6.1.0",
    "@angular/platform-browser-dynamic": "~6.1.0",
    "@angular/router": "~6.1.0",
    "@types/jwt-decode": "^2.2.1",
    "jwt-decode": "^2.2.0",
    "nativescript-angular": "^6.1.0",
    "nativescript-localize": "^3.0.5",
    "nativescript-permissions": "1.2.3",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-toast": "1.4.6",
    "nativescript-ui-sidedrawer": "~4.2.1",
    "nativescript-unit-test-runner": "^0.3.4",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.0.0",
    "rxjs-compat": "^6.2.2",
    "tns-core-modules": "^4.2.0",
    "tns-platform-declarations": "4.1.0",
    "tslib": "^1.9.3",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.1.0",
    "@ngtools/webpack": "~6.1.0",
    "@types/jasmine": "^2.8.8",
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "codelyzer": "~4.0.2",
    "jasmine-core": "^3.1.0",
    "karma": "^2.0.4",
    "karma-jasmine": "^1.1.2",
    "karma-nativescript-launcher": "^0.4.0",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "^0.7.2",
    "nativescript-dev-webpack": "^0.15.1",
    "tslint": "~5.8.0",
    "typescript": "~2.7.2"
  }

@dpfavand
Copy link

Reverting to Nativescript 4.1 fixes the issue

@MonasteryJohn
Copy link

Same problem on a Samsung S9, with the device being off by 1...see screenshot.

image

Oddly if I plug in another device (S9+) the issue doesn't seem to happen on that device.

@MonasteryJohn
Copy link

One thing I noticed, on the S9+ that works, the device ID has an alpha character in it (433630384c513098) which is likely why whatever -1 issue the S9 has is not happening.

@rosen-vladimirov rosen-vladimirov self-assigned this Sep 16, 2018
@rosen-vladimirov rosen-vladimirov added this to the 4.2.4 milestone Sep 17, 2018
@rosen-vladimirov rosen-vladimirov changed the title Error while trying to start application ... on device 0034008422. Error is: Devices.NotFoundDeviceByIndexErrorMessage Unable to work with devices with numeric identifiers Sep 17, 2018
@rosen-vladimirov
Copy link
Contributor

Hey all,
Thank you for reporting this issue. We have applied a fix, that is already available in our rc version, you can give it a try by installing this version of CLI:

npm i -g nativescript@rc

The fix will be included in our incoming 4.2.4 release.

@MonasteryJohn
Copy link

Thanks @rosen-vladimirov I tried with the RC version this morning and the numeric device seems to be working correctly. Thanks for the fix!

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

No branches or pull requests

7 participants