Skip to content

Alias resolution not working correctly with "@nativescript/android": "9.1.2", #2154

Done

Description

@cjohn001

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
✔ Getting NativeScript components versions information...
✔ Component nativescript has 9.1.2 version and is up to date.
✔ Component @nativescript/core has 9.1.4 version and is up to date.
✔ Component @nativescript/ios has 9.1.1 version and is up to date.
✔ Component @nativescript/android has 9.1.2 version and is up to date.

Describe the bug
When updating from 9.1.1 to 9.1.2 the resolution of aliases seems to be broken.

Old code crashing the app:
const IMarker = com.github.mikephil.charting.components.IMarker;

@nativeclass()
@Interfaces([IMarker])
export class NChartsMultiSeriesMarker extends java.lang.Object implements com.github.mikephil.charting.components.IMarker {...

Bugfix is to use the full class name in the interface directly, rather then via the alias:

@nativeclass()
@Interfaces([com.github.mikephil.charting.components.IMarker])
export class NChartsMultiSeriesMarker extends java.lang.Object implements com.github.mikephil.charting.components.IMarker {}

One can also observe the issue by

const cls = marker.getClass();
console.log('Java class:', cls.getName());
console.log(
'Assignable:',
com.github.mikephil.charting.components.IMarker.class
.isAssignableFrom(cls)
);


Java class: com.tns.gen.java.lang.Object_bundle_94377c_19423_28_NChartsMultiSeriesMarker
Assignable: false


When using the full name in the interface directly the interface is correctly resolved and results in


Java class: com.tns.gen.java.lang.Object_bundle_94377c_19423_28_NChartsMultiSeriesMarker
Assignable: true

Expected behavior
The runtime should not crash

Activity

  1. cjohn001 commented on Nov 26, 2026

    @cjohn001
    Author

    Fixed with 9.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions