`tns run android --bundle` does not build Android background services


I build my app with webpack using tns run android --bundle but this does not build the Android Services that I include with my app. Only when I run tns run android do I see my services included in the build output at platforms/android/app/src/main/java/com/tns/MyService.java. How do I build my Android services while using webpack?


Have you added your service to “appComponents” in webpack.config.js? Like

const appComponents = [
    resolve(__dirname, "app/yourService.ts"),

Also I’m curious, does this mean you are considering NativeScript for Bitwarden?


Yes, we’ve been slowly moving all of our client applications to angular so it would be good to do the same with our mobile app. Unfortunately there a few showstopper blocking issues that I have not been able to get answers for with nativescript so for now we cannot.


What are the showstopping issues? (Not sure if you remember my handle, I’m the Passit developer). Always up for collaboration! I have a super basic autofill service with nativescript already. Hoping to remove the beta label off it this week or so.


The issues we face mostly come from NativeScript iOS, and it’s inability to use iOS app extensions. See https://github.com/NativeScript/ios-runtime/issues/929

Without the ability to create an app extension for autofill, which is a primary function of the Bitwarden app, we cannot proceed.

I don’t think that there are any blockers on Android any longer, but we can’t just create an app for Android only.


Looks like appComponents is a new thing. This wasn’t available in the webpack.config.js template when I originally posted this question.


Thanks @bufke . Setting the services in appComponents now works.