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


#1

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?


#2

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

const appComponents = [
    "tns-core-modules/ui/frame",
    "tns-core-modules/ui/frame/activity",
    resolve(__dirname, "app/yourService.ts"),
];

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


#3

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.


#4

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.


#5

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.


#6

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


#7

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