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

when you bundle with snapshot and then bundle without it, you will see exception in release #463

Closed
miroslavaivanova opened this issue Mar 14, 2018 · 0 comments · Fixed by #465
Assignees
Labels

Comments

@miroslavaivanova
Copy link
Contributor

Tell us about the problem

This happens when you build in release. Build android with bundle and snapshot in release and then build it only with bundle. You will see exception.

File:/Users/mivanova/MyDocuments/app2/platforms/android/app/src/main/java/com/tns/FragmentClass.java Class: com.tns.FragmentClass
        at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:65)
        at org.nativescript.staticbindinggenerator.Main.main(Main.java:48)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:runSbg'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* 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 8s
Command ./gradlew failed with exit code 1

Local environment

Platform: Mac
NativeScript CLI version: next

  1. tns build android --bundle --env.snapshot --release
  2. tns build android --bundle --release
@sis0k0 sis0k0 self-assigned this Mar 14, 2018
sis0k0 added a commit to NativeScript/nativescript-cli that referenced this issue Mar 15, 2018
If prepare of the project is required and the bundle option is passed,
the platforms/.../app/ dir should be deleted as there may be old assets
left.

Ex.
When the app bundled with snapshot enabled:
```
tns build android --bundle --env.snapshot
```
this produces some assets:
```
platforms/android/.../app/vendor.js
platforms/android/.../app/_embedded_script.js
// ...
```

Then, if the project is bundled without snapshot:
```
tns build android --bundle
```
the produced assets will override the ones that are already in
`platforms/android/.../app`. However, since the build is without
snapshot, an `_embedded_script.js` won't be generated to override the one
that's left in `platforms/android/.../app` from the previous build.

fixes NativeScript/nativescript-dev-webpack#463
sis0k0 added a commit that referenced this issue Mar 17, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets
left.

Ex.
When the app bundled with snapshot enabled:
```
tns build android --bundle --env.snapshot
```
this produces some assets:
```
platforms/android/.../app/vendor.js
platforms/android/.../app/_embedded_script.js
// ...
```

Then, if the project is bundled without snapshot:
```
tns build android --bundle
```
the produced assets will override the ones that are already in
`platforms/android/.../app`. However, since the build is without
snapshot, an `_embedded_script.js` won't be generated to override the one
that's left in `platforms/android/.../app` from the previous build.

We'll be using `CleanWebpackPlugin` to clean the dist folder.
** Important **: Currently we're running two webpack builds when doing
`tns run android|ios` - one on prepare and one when the watcher starts.
This means that the dist folder will be cleaned two times. This will be
resolved when
NativeScript/nativescript-cli#3404 is
implemented.

fixes #463
sis0k0 added a commit that referenced this issue Mar 21, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets
left.

Ex.
When the app bundled with snapshot enabled:
```
tns build android --bundle --env.snapshot
```
this produces some assets:
```
platforms/android/.../app/vendor.js
platforms/android/.../app/_embedded_script.js
// ...
```

Then, if the project is bundled without snapshot:
```
tns build android --bundle
```
the produced assets will override the ones that are already in
`platforms/android/.../app`. However, since the build is without
snapshot, an `_embedded_script.js` won't be generated to override the one
that's left in `platforms/android/.../app` from the previous build.

We'll be using `CleanWebpackPlugin` to clean the dist folder.
** Important **: Currently we're running two webpack builds when doing
`tns run android|ios` - one on prepare and one when the watcher starts.
This means that the dist folder will be cleaned two times. This will be
resolved when
NativeScript/nativescript-cli#3404 is
implemented.

fixes #463
sis0k0 added a commit that referenced this issue Mar 21, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets
left.

Ex.
When the app bundled with snapshot enabled:
```
tns build android --bundle --env.snapshot
```
this produces some assets:
```
platforms/android/.../app/vendor.js
platforms/android/.../app/_embedded_script.js
// ...
```

Then, if the project is bundled without snapshot:
```
tns build android --bundle
```
the produced assets will override the ones that are already in
`platforms/android/.../app`. However, since the build is without
snapshot, an `_embedded_script.js` won't be generated to override the one
that's left in `platforms/android/.../app` from the previous build.

We'll be using `CleanWebpackPlugin` to clean the dist folder.
** Important **: Currently we're running two webpack builds when doing
`tns run android|ios` - one on prepare and one when the watcher starts.
This means that the dist folder will be cleaned two times. This will be
resolved when
NativeScript/nativescript-cli#3404 is
implemented.

fixes #463
sis0k0 added a commit that referenced this issue Mar 22, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets
left.

Ex.
When the app bundled with snapshot enabled:
```
tns build android --bundle --env.snapshot
```
this produces some assets:
```
platforms/android/.../app/vendor.js
platforms/android/.../app/_embedded_script.js
// ...
```

Then, if the project is bundled without snapshot:
```
tns build android --bundle
```
the produced assets will override the ones that are already in
`platforms/android/.../app`. However, since the build is without
snapshot, an `_embedded_script.js` won't be generated to override the one
that's left in `platforms/android/.../app` from the previous build.

We'll be using `CleanWebpackPlugin` to clean the dist folder.
** Important **: Currently we're running two webpack builds when doing
`tns run android|ios` - one on prepare and one when the watcher starts.
This means that the dist folder will be cleaned two times. This will be
resolved when
NativeScript/nativescript-cli#3404 is
implemented.

fixes #463
sis0k0 added a commit that referenced this issue Mar 22, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets
left.

Ex.
When the app bundled with snapshot enabled:
```
tns build android --bundle --env.snapshot
```
this produces some assets:
```
platforms/android/.../app/vendor.js
platforms/android/.../app/_embedded_script.js
// ...
```

Then, if the project is bundled without snapshot:
```
tns build android --bundle
```
the produced assets will override the ones that are already in
`platforms/android/.../app`. However, since the build is without
snapshot, an `_embedded_script.js` won't be generated to override the one
that's left in `platforms/android/.../app` from the previous build.

We'll be using `CleanWebpackPlugin` to clean the dist folder.
** Important **: Currently we're running two webpack builds when doing
`tns run android|ios` - one on prepare and one when the watcher starts.
This means that the dist folder will be cleaned two times. This will be
resolved when
NativeScript/nativescript-cli#3404 is
implemented.

fixes #463
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants