Skip to content

use in Java - error: reference to getMetadata is ambiguous #5

Description

@paulvi
public static void main(String[] args) {
        String rpcUrl = "wss://127.0.0.1:9944";
        var provider = new SubstrateProvider(rpcUrl);
        var meta = provider.getMetadata().blockingGet();

}

build and get error

 % gradle build

> Task :compileJava FAILED
bcd-java/src/main/java/UsingSubstrateClientKotlin.java:10: error: reference to getMetadata is ambiguous
        var meta = provider.getMetadata().blockingGet();
                           ^
  both method getMetadata() in SubstrateProvider and method getMetadata() in SubstrateProvider match
bcd-java/src/main/java/UsingSubstrateClientKotlin.java:10: error: cannot find symbol
        var meta = provider.getMetadata().blockingGet();
                                         ^
  symbol:   method blockingGet()
  location: class RuntimeMetadata
2 errors

FAILURE: Build failed with an exception.

For sure this should be "call Kotlin from Java" issue, however I have no clue how to solve

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions