{"record":{"id":"8280d8a319301eba","repo":"NativeScript/NativeScript","slug":"abstract-method-call","errorCode":null,"errorMessage":"Abstract method call","messagePattern":"Abstract method call","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/ui/transition/index.android.ts","lineNumber":39,"sourceCode":"\t\tthis._interpolator = curve ? _resolveAnimationCurve(curve) : _defaultInterpolator();\n\t\ttransitionId++;\n\t\tthis.id = transitionId;\n\t}\n\n\tpublic getDuration(): number {\n\t\treturn this._duration;\n\t}\n\n\tpublic setDuration(value: number) {\n\t\tthis._duration = value;\n\t}\n\n\tpublic getCurve(): android.view.animation.Interpolator {\n\t\treturn this._interpolator;\n\t}\n\n\tpublic animateIOSTransition(transitionContext: any, fromViewCtrl: any, toViewCtrl: any, operation: any): void {\n\t\tthrow new Error('Abstract method call');\n\t}\n\n\tpublic createAndroidAnimator(transitionType: string): android.animation.Animator {\n\t\tthrow new Error('Abstract method call');\n\t}\n\n\tpublic toString(): string {\n\t\treturn `Transition@${this.id}`;\n\t}\n}\n","sourceCodeStart":21,"sourceCodeEnd":50,"githubUrl":"https://github.com/NativeScript/NativeScript/blob/6800aefa6511d23ddad8beb38ccc8541c5e91628/packages/core/ui/transition/index.android.ts#L21-L50","documentation":"The Transition base class on Android declares animateIOSTransition as an abstract-like method whose default implementation throws 'Abstract method call' (index.android.ts:39). It is a deliberate stub: only concrete Transition subclasses that implement iOS-style transition hooks should be invoked this way. Hitting it means a transition object lacking the required override was used where a fully implemented transition is expected.","triggerScenarios":"Calling transition.animateIOSTransition(...) directly on a base Transition instance or a custom subclass that did not override animateIOSTransition; instantiating Transition itself and passing it to navigation APIs expecting a concrete transition.","commonSituations":"Writing a custom page transition by extending Transition but only overriding createAndroidAnimator/getCurve; upgrading NativeScript where a previously used helper class no longer overrides this method; copy-pasting a base-class reference instead of a concrete transition (e.g. new Transition() instead of new SlideTransition()).","solutions":["Use a concrete built-in transition (FadeTransition, SlideTransition, etc.) instead of the base Transition class.","If writing a custom transition, override animateIOSTransition in your subclass and implement the iOS transition logic (or leave it as a no-op for Android-only transitions).","Check the object actually being passed is the subclass instance, not the base class, at the call site.","Compare your subclass against the built-in transitions in packages/core/ui/transition to see which methods are expected to be overridden."],"exampleFix":"// before\nconst transition = new Transition(300); // base class, no override\n// after\nclass MyTransition extends Transition {\n  animateIOSTransition(transitionContext, fromViewCtrl, toViewCtrl, operation) {\n    // implement or intentionally no-op for Android-only transitions\n  }\n}\nconst transition = new MyTransition(300);","handlingStrategy":"type-guard","validationCode":"function hasIosTransition(t) {\n  return t && typeof t.animateIOSTransition === 'function' && t.animateIOSTransition !== Transition.prototype.animateIOSTransition;\n}","typeGuard":"function isConcreteTransition(t: Transition): boolean {\n  return Object.getPrototypeOf(t).constructor !== Transition\n    && t.animateIOSTransition !== Transition.prototype.animateIOSTransition;\n}","tryCatchPattern":"try {\n  transition.animateIOSTransition(ctx, from, to, op);\n} catch (e) {\n  if (String(e.message).includes('Abstract method call')) {\n    console.error('Transition subclass does not implement animateIOSTransition');\n    transition = new FadeTransition(300);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Never instantiate the base Transition class directly; use a concrete subclass.","When writing custom transitions, override every abstract hook or document which platforms it supports.","Add a runtime check that the override differs from the prototype stub before registering the transition.","Compare your subclass against built-in transitions in packages/core/ui/transition for the expected override set."],"tags":["nativescript","transition","abstract-method","android","navigation"],"backgroundTag":"abstract-method-call","analyzedSha":"6800aefa6511d23ddad8beb38ccc8541c5e91628","analyzedAt":"2026-08-30T20:04:56.809Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}