Skip to content

Support for abstract interface with static methods #1157

@vtrifonov

Description

@vtrifonov

Currently the android runtime does not support calls to static methods which are implemented in abstract interfaces e.g.:

package com.tns.tests;

public abstract interface AbstractInterface {

    public static int test()
    {
        return 1;
    }
}

A call like this:

var test = com.tns.tests.AbstractInterface.test();

will result in:

Error: java.lang.NoSuchMethodError: no static method "Lcom/tns/tests/AbstractInterface;.test()I"
    com.tns.Runtime.callJSMethodNative(Native Method)
    com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
    com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
    com.tns.Runtime.callJSMethod(Runtime.java:983)
    com.tns.Runtime.callJSMethod(Runtime.java:967)
    com.tns.Runtime.callJSMethod(Runtime.java:959)
    com.tns.gen.android.view.View_OnClickListener.onClick(View_OnClickListener.java:16)
    android.view.View.performClick(View.java:5637)
    android.view.View$PerformClick.run(View.java:22429)
    android.os.Handler.handleCallback(Handler.java:751)
    android.os.Handler.dispatchMessage(Handler.java:95)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6119)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Using Google WebRTC causes this error:

dependencies {
    implementation 'org.webrtc:google-webrtc:1.0.+'
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions