xplat
xplat copied to clipboard
Nativescript platform specific components won't build
I have an Angular component in a Nativescript project (located at libs/xplat/nativescript/features/src/lib/ui/components) which has 2 implementations for Android and iOS and both extend a base component in the same directory. I also defined a .d.ts file. So the component directory includes:
my-component.base-component.ts
my-component.component.android.ts
my-component.component.ios.ts
my-component.component.d.ts
my-component.component.html
The build fails with this error:
my-component.component.android.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
Adding the **/*.android.ts, **/*.ios.ts and **/*.d.ts in tsconfig.lib.json doesn't have any effect. But adding ../../**/*.android.ts, ../../**/*.ios.ts and ../../**/*.d.ts in tsconfig..app.json fixes that error but generates more errors:
'AbsoluteLayout' is not a known element
The component is declared in the UI module using the .d.ts which imports NativeScriptCommonModule So the AbsoluteLayout should be available.