app build inside child_process fails
wendt88 opened this issue · 2 comments
wendt88 commented
I tried to automate the build process and run the command with a child_process.
I tried the exec and spawn methods, but get always the same error:
Please change the name of one of the extended classes.
File:<APPROOT>\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:53)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:runSbg'.
> Process 'command 'C:\Program Files\AdoptOpenJDK\jdk8u192-b12\bin\java.exe'' 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 43s
Command gradlew.bat failed with exit code 1
when I remove the workers it builds correctly. is there maby an option to get it work, or is it a bug?
dmdnkv commented
The same problem.
However, it happens even after just cloning this repository, install and build without any additional actions.
node --version
v10.14.0
tns --version
6.2.0
java -showversion
java version "1.8.0_211"
Android SDK Build Tools: 28.0.3
Windows 10 Enterprise 1809 17763.615
git clone https://github.com/NativeScript/worker-loader.git
cd demo-angular
npm install
tns build android
...
Webpack compilation complete. Watching for file changes.
Webpack build done!
Project successfully prepared (android)
Building project...
Gradle build...
+ setting applicationId
+ applying user-defined configuration from C:\Projects\worker-loader\demo-angular\app\App_Resources\Android\app.gradle
+ using android X library androidx.legacy:legacy-support-v4:1.0.0
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: C:\Projects\worker-loader\demo-angular\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
Error executing Static Binding Generator: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File:C:\Projects\worker-loader\demo-angular\platforms\android\app\src\main\java\com\tns\FragmentClass.java Class: com.tns.FragmentClass
Detailed log here: C:\Projects\worker-loader\demo-angular\platforms\android\build-tools\runSbg.log
Command gradlew.bat failed with exit code 1
Removal of both workers from the project leads to a successful build.
Any suggestions?