Skip to content

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jun 15, 2019

When tns run android --release --env.snapshot command is executed, { skipWatcher: true } option is provided. On the other side watch option has default true value so as a result we have { skipWatcher: true and watch: true }. So a release run is started in watch mode. As the watch option is true, NativeScript CLI starts webpack in watch mode. This led to the problem that webpack reports emitted files before the snapshot generation is completed. (note: there is an another issue inside nativescript-dev-webpack plugin itself about the way how emitted files are reported - it should be fixed there.)
As a result, an async issue arise between snapshot generation and gradle build and the following error is thrown:

Warning: The static binding generator will generate extend from:vendor.js implementation
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File: ./platforms/android/app/src/main/java/com/tns/FragmentClass.java Class: com.tns.FragmentClass
        at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:112)
        at org.nativescript.staticbindinggenerator.Main.main(Main.java:48)

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

@cla-bot cla-bot bot added the cla: yes label Jun 15, 2019
When `tns run android --release --env.snapshot` command is executed, `{ skipWatcher: true }` option is provided. On the other side watch option has default true value so as a result we have { skipWatcher: true and watch: true }. This led to the problem that release run is started in watch mode. As the watch option is true, NativeScript CLI starts webpack in watch mode. This led to the problem that webpack reports emitted files before the snapshot generation is completed. (note: there is an another issue inside nativescript-dev-webpack plugin itself about the way how emitted files are reported - it should be fixed there.)
As a result, an async issue arise between snapshot generation and gradle build and the following error is thrown:
```
Warning: The static binding generator will generate extend from:vendor.js implementation
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File: ./platforms/android/app/src/main/java/com/tns/FragmentClass.java Class: com.tns.FragmentClass
        at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:112)
        at org.nativescript.staticbindinggenerator.Main.main(Main.java:48)
```
@Fatme Fatme force-pushed the fatme/fix-snapshot branch from 5daaf8c to 896f959 Compare June 17, 2019 09:00
@Fatme Fatme merged commit d68af4a into feature/webpack-only Jun 17, 2019
@Fatme Fatme deleted the fatme/fix-snapshot branch June 17, 2019 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants