So I’ve hit a weird bug when trying to use UglifyJS on the NativeScript Groceries sample and I could use some help. Here’s how you can recreate the problem.
git clone https://github.com/NativeScript/sample-Groceries.git cd sample-Groceries npm install npm run start-android-bundle --uglify
Here’s the exception.
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.ateBindings Please change the name of one of the extended classes. File:/Users/tj/dev/nativescript/sample-Groceries/platforms/android/src/main/java/com/tns/gen/java/lang/Object_frnal_ts_helpers_l58_c38__t.java Class: at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:68) at org.nativescript.staticbindinggenerator.Main.main(Main.java:15) :asbg:generateBindings FAILED FAILURE: Build failed with an exception. * Where: Build file '/Users/tj/dev/nativescript/sample-Groceries/platforms/android/build-tools/android-static-binding-generator/build.gradle' line: 254 * What went wrong: Execution failed for task ':asbg:generateBindings'. > Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.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. BUILD FAILED
The same build works if I remove the
--uglify flag. After some looking around it looks like I’ve probably hit this issue, but that doesn’t help me figure out how to workaround this; the error message isn’t the most descriptive one I’ve ever seen.
Any help would be really appreciated. Thanks!