Skip to content

Run / Livesync Not Working For Android On 2.5.2 #2795

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
dtopuzov opened this issue May 9, 2017 · 19 comments
Closed

Run / Livesync Not Working For Android On 2.5.2 #2795

dtopuzov opened this issue May 9, 2017 · 19 comments

Comments

@dtopuzov
Copy link
Contributor

dtopuzov commented May 9, 2017

From @nraboy on March 3, 2017 3:4

Please, provide the details below:

This issue has existed since 2.5.0, and was tested in 2.5.2 without success. Both myself and another user are using Genymotion and trying to deploy our application using the following command:

tns run android

The application deploys to the simulator the first time, but does not open on the simulator. Saving changes seems to trigger a rebuild process, but it never seems to make it to the simulator.

Everything works fine on iOS.

Did you verify this is a real problem by searching [Stack Overflow]

Didn't check. Experiencing the problem first hand on Mac and Windows when it worked fine prior to 2.5.0.

Which platform(s) does your issue occur on?

Android

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

CLI: 2.5.2
Mac El Capitan
Windows 10

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

Try to deploy on Genymotion. Try to save project and redeploy to Genymotion.

Copied from original issue: NativeScript/NativeScript#3734

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

Can you reproduce the issue with hello-world application?
If you can't repro on hello-wolrd app can you please post package.json of your application.
It might be some 3rd party plugin that breaks the livesync.

Can you also give it a try on real device or default Android Studio emulators?

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @loadchief on March 4, 2017 18:5

I had the same issue that Nic describes above.
I will try with a new hello-world app soon.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

@nraboy @loadchief Please post package.json files of your projects, I believe problem is related to some 3rd party plugin since I can't reproduce at my end.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @loadchief on March 4, 2017 19:44

package.zip

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @nraboy on March 4, 2017 22:41

I'm wondering if the nativescript-mapbox plugin is causing issues:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.tempProject",
    "tns-android": {
      "version": "2.5.0"
    }
  },
  "dependencies": {
    "@angular/common": "2.4.3",
    "@angular/compiler": "2.4.3",
    "@angular/core": "2.4.3",
    "@angular/forms": "2.4.3",
    "@angular/http": "2.4.3",
    "@angular/platform-browser": "2.4.3",
    "@angular/platform-browser-dynamic": "2.4.3",
    "@angular/router": "3.4.3",
    "nativescript-angular": "1.4.0",
    "nativescript-mapbox": "git+https://github.com/EddyVerbruggen/nativescript-mapbox.git",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.0.1",
    "tns-core-modules": "2.5.0"
  },
  "devDependencies": {
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-typescript": "~0.3.5",
    "typescript": "~2.1.0",
    "zone.js": "~0.7.2"
  }
}

I tried a fresh project and it worked. I tried a different project of mine and it worked.

Any suggestions @dtopuzov? It might not be isolated to only that plugin and in any case, it prevents all possible development with NativeScript.

Best,

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @roblav96 on March 6, 2017 19:12

@nraboy @dtopuzov @loadchief
You guys should try to uninstall your android app and reinstalling. I've noticed that if the app id "id": "org.nativescript.tempProject" does not match the installed version livesync will not work.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @nraboy on March 6, 2017 19:38

We tried that @roblav96. It works the first time, but fails every time that follows.

Thanks for the suggestion though.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @alexziskind1 on March 9, 2017 23:43

I have the same thing happening with one of my demo apps on my Mac with Genymotion. But when I try it with a hello world template, it works as expected.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @JamesLM on March 10, 2017 8:20

We are also using Mapbox and assumed it was also causing the issue, however @roblav96's solution worked for us.

i.e. App_Resources/Android/app.gradle android.applicationId didn't match the nativescript.id in package.json. Manually changing these to match solved the issue.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @gaurav-chandra on May 8, 2017 7:27

a hello world tns 3 ng app is not live syncing for me too on android.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

@gaurav-chandra Can you please give us some more details, please post your exact package.json and tns version.

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @gaurav-chandra on May 9, 2017 5:7

  1. tns version 3
  2. NS Webpack installed
  3. Package.json
{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.HelloWorldNg3",
    "tns-android": {
      "version": "3.0.0"
    }
  },
  "dependencies": {
    "@angular/animations": "~4.1.0",
    "@angular/common": "~4.1.0",
    "@angular/compiler": "~4.1.0",
    "@angular/core": "~4.1.0",
    "@angular/forms": "~4.1.0",
    "@angular/http": "~4.1.0",
    "@angular/platform-browser": "~4.1.0",
    "@angular/router": "~4.1.0",
    "nativescript-angular": "~3.0.0",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.3.0",
    "tns-core-modules": "~3.0.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~4.1.0",
    "@ngtools/webpack": "1.3.1",
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.0",
    "copy-webpack-plugin": "~4.0.1",
    "extract-text-webpack-plugin": "~2.1.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "~0.4.0",
    "nativescript-dev-webpack": "^0.4.2",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.0.2",
    "typescript": "~2.2.1",
    "webpack": "~2.4.1",
    "webpack-sources": "~0.2.3"
  },
  "scripts": {
    "ns-bundle": "ns-bundle",
    "start-android-bundle": "npm run ns-bundle --android --start-app",
    "start-ios-bundle": "npm run ns-bundle --ios --start-app",
    "build-android-bundle": "npm run ns-bundle --android --build-app",
    "build-ios-bundle": "npm run ns-bundle --ios --build-app"
  }
}

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 9, 2017

From @carrbrpoa on May 9, 2017 20:2

Same problem that @gaurav-chandra pointed; tns 3.0.0. But, in my case, it only doesn't works with angular templates (which I'm giving .html extension) and CSS.
GIF demonstrating: https://giphy.com/gifs/3ohze2CvSPvtz8QHBu/fullscreen

I'm running with tns run android. Someone suggested to use --clean flag, that didn't help.

package.json:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.OSUrbApp",
    "tns-android": {
      "version": "3.0.0"
    }
  },
  "dependencies": {
    "@angular/animations": "~4.1.0",
    "@angular/common": "~4.1.0",
    "@angular/compiler": "~4.1.0",
    "@angular/core": "~4.1.0",
    "@angular/forms": "~4.1.0",
    "@angular/http": "~4.1.0",
    "@angular/platform-browser": "~4.1.0",
    "@angular/router": "~4.1.0",
    "nativescript-angular": "~3.0.0",
    "nativescript-camera": "^3.0.0",
    "nativescript-couchbase": "^1.0.18",
    "nativescript-imagepicker": "^3.0.0",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.3.0",
    "tns-core-modules": "~3.0.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "~0.4.0",
    "typescript": "~2.2.1"
  }
}

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 12, 2017

@gaurav-chandra @carrbrpoa your issue looks to be same as #2780
Can you please try with {N} 3.0.1, it should be fixed there.

@loadchief you posted package.json inside your app folder, can you please post the one at project root level if you still experience the issue.

@nraboy I see you use
"nativescript-mapbox": "git+https://github.com/EddyVerbruggen/nativescript-mapbox.git"
but plugin code is not in the root of the repo (pacakge.json is not there) and I think this is the problem.

@gaurav-chandra
Copy link

@dtopuzov yes, it works not on 3.0.1

@carrbrpoa
Copy link

@dtopuzov, I noticed HTML do refreshes the app, but CSS no not. Is it the expected?

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 12, 2017

@carrbrpoa can you reproduce it on hello-world app?

I can not reproduce with those steps:

npm un -g nativescript
npm cache clean
npm i -g [email protected]
tns create TestAppNG --ng
tns run android
Repalce `core.light.css` with `core.dark.css` in `app.css` -> change is applied.

Can you provide steps how to reproduce the issue?

@carrbrpoa
Copy link

@dtopuzov, actually now I'm not being able to run tns run android and I'm not sure if it's because of the update or not. There's a 1MB stack file here, do you want to see? :p

@dtopuzov
Copy link
Contributor Author

dtopuzov commented May 12, 2017

Hi @carrbrpoa
You can create gist or upload it somewhere and send link.
I don't believe it is cased by 3.0.1 since are code changes are minor.

I think for CSS you hit this case: #2780 (comment)

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

4 participants