Open des-esseintes opened 6 years ago
Hi, I'm having the same error when building with the snapshot flag on, getting this error:
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:/path/to/project/platforms/android/app/src/main/java/com/tns/NotificationEventReceiver.java Class: com.tns.NotificationEventReceiver Detailed log here: /path/to/project/platforms/android/build-tools/runSbg.log
the content of the log file /path/to/project/platforms/android/build-tools/runSbg.log:
Warning: there already is an extend called com.tns.NotificationEventReceiver.
Warning: The static binding generator will generate extend from:1.js implementation
Warning: there already is an extend called com.tns.NotificationIntentService.
Warning: The static binding generator will generate extend from:1.js implementation
java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File:/path/to/project/platforms/android/app/src/main/java/com/tns/NotificationEventReceiver.java Class: com.tns.NotificationEventReceiver
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:112)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:55)
I run this command: tns build android --release --env.uglify --env.aot --env.snapshot --key-store-path 'keystore-file-path.ext' --key-store-password 'password' --key-store-alias 'Alias' --key-store-alias-password 'aliasPassword' --copy-to './' --bundle
the build pass without the snapshot flag without errors.
Platform Mac os Catalina 10.15.2 Node version: 12.8.1 NativeScript CLI version 6.3.0
I'm having the same issue. Have any of you found a solution?
Hey guys, Can you please send a package.json and ideally a sample application reproducing the issue. It seems some of the plugins or your local code conflicts with extending the same class multiple times which leads to the error. We cannot determine the cause without more information on this case as the problem seems related to the application itself or the usage of specific plugins.
Hello!
Issue Checklist
Tell us about the problem
I'm having a service and a receiver described in AndroidManifest.xml, and a couple of js files extending the classes (all taken from nativescript background services example working w/ android's alarmManager). everything seems to be fine when using no webpack or just plain webpack, but goes out of control w/ snapshot generation:
Local environment
Project data
const { join, relative, resolve, sep } = require("path");
const webpack = require("webpack"); const nsWebpack = require("nativescript-dev-webpack"); const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target"); const CleanWebpackPlugin = require("clean-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin"); const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
module.exports = env => { // Add your custom Activities, Services and other android app components here. const appComponents = [ "tns-core-modules/ui/frame", "tns-core-modules/ui/frame/activity", resolve(dirname, "app/notifications/NotificationEventReceiver"), resolve(dirname, "app/notifications/NotificationIntentService"), resolve(__dirname, "app/notifications/NotificationServiceStarterReceiver"), ];
};