Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

refactor: update Android project path to support next runtime #310

Merged
merged 5 commits into from
Nov 19, 2017

Conversation

Plamen5kov
Copy link
Contributor

problem
nativescript-dev-webpack is not compatible with new android studio project template

solution
need to change bundle output path, depending on the android template version

Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after green CI and new android template is published in next

@Plamen5kov Plamen5kov self-assigned this Nov 6, 2017
@NativeScript NativeScript deleted a comment from dtopuzov Nov 8, 2017
@NativeScript NativeScript deleted a comment from dtopuzov Nov 8, 2017
@NativeScript NativeScript deleted a comment from Plamen5kov Nov 8, 2017
@NativeScript NativeScript deleted a comment from Plamen5kov Nov 8, 2017
@vchimev
Copy link
Contributor

vchimev commented Nov 8, 2017

Command: npm run build-android-bundle

Prerequisites:

mcsofvchimev:appNG vchimev$ tns --version
3.4.0-2017-11-08-10093
mcsofvchimev:appNG vchimev$ cat package.json
{
  ...
  "tns-android": {
      "version": "3.4.0-2017-11-8-1"
  }
  ...
  "dependencies": {
    "@angular/animations": "~4.4.1",
    "@angular/common": "~4.4.1",
    "@angular/compiler": "~4.4.1",
    "@angular/core": "~4.4.1",
    "@angular/forms": "~4.4.1",
    "@angular/http": "~4.4.1",
    "@angular/platform-browser": "~4.4.1",
    "@angular/router": "~4.4.1",
    "nativescript-angular": "~4.4.0",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.4.2",
    "tns-core-modules": "~3.3.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~4.4.1",
    "@ngtools/webpack": "~1.6.0",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "copy-webpack-plugin": "~4.0.1",
    "extract-text-webpack-plugin": "~3.0.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "~0.5.0",
    "nativescript-dev-webpack": "file:../../git/nativescript-dev-webpack",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.1.0",
    "typescript": "~2.4.2",
    "webpack": "~3.2.0",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1"

Output:

Gradle build...
         + creating include.gradle for plugin /Users/vchimev/Work/tmp/appNG/platforms/node_modules/tns-core-modules-widgets
         + applying plugin configuration from /Users/vchimev/Work/tmp/appNG/platforms/android/app/build/configurations/tns-core-modules-widgets/include.gradle
         + applying user-defined configuration from /Users/vchimev/Work/tmp/appNG/app/App_Resources/Android/app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized
         + adding aar plugin dependency: /Users/vchimev/Work/tmp/appNG/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
false
Running full build

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/vchimev/Work/tmp/appNG/platforms/android/build-tools/android-static-binding-generator/build.gradle' line: 281

* What went wrong:
Execution failed for task ':asbg:generateBindings'.
> No /Users/vchimev/Work/tmp/appNG/platforms/android/build-tools/android-static-binding-generator/bindings.txt was found after runAstParser task was ran! Check to see if there are any .js files inside /Users/vchimev/Work/tmp/appNG/platforms/android/app/src/main/assets/app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

@vchimev vchimev force-pushed the plamen5kov/android-studio-compatibility branch from 9c62919 to 110221d Compare November 14, 2017 06:46
@sis0k0 sis0k0 changed the title update resource output path refactor: update Android project path to support next runtime Nov 15, 2017
Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean snapshot and install snapshot methods from ProjectSnapshotGenerator should be updated, too.

@vchimev
Copy link
Contributor

vchimev commented Nov 16, 2017

report > build-android-bundle > verifications > assets

name: vendor.js

isOverSizeLimit: true

error: Asset is over size limit! Expected: 3176000. Actual: 3177377.

@sis0k0
Copy link
Contributor

sis0k0 commented Nov 16, 2017

@vchimev Which is that flavor? Debug/webpack/android/ios/uglify/snapshot? Do you have the project that you measured the 'test' numbers against or a timeline report from it?

@sis0k0 sis0k0 merged commit fc45d4f into master Nov 19, 2017
@sis0k0 sis0k0 deleted the plamen5kov/android-studio-compatibility branch November 19, 2017 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants