hedera-sdk-java icon indicating copy to clipboard operation
hedera-sdk-java copied to clipboard

driod API 33, ContractFunctionResult using Stream ? tripping up. java.lang.NoSuchMethodError: No interface method toList()Ljava/util/List; in class Ljava/util/stream/Stream

Open johnda98 opened this issue 8 months ago • 14 comments

Description

yeah.. kinda at a Client impasse now @Datadamus as unable to use HH SDK to read the Wallet Users profile SC and Query and Execution seem to use Stream dependency and it seems to not get sucked into emulator runtime yet compile build is fine.

" ContractFunctionResult result_1 = new ContractCallQuery() .setGas(30000) .setContractId(existing) .setFunction("getfname") // .setMaxQueryPayment(new Hbar(1)) .execute(USER_ACCOUNT);"

digging deeper .. droid studio, 1.8 compat, compiling for API33.. droid 13.. HH SDK and gRPC is checked - as per github for droid..ok

droid does support java 8 from version 7 Nougat and Stream was in 8. . noted API26 hedera SDK min.

ContractFunctionResult using Stream ? Studio config looks ok. later in thread - copy of gradles.

Process: com.mvp.olarawallet, PID: 10463 java.lang.NoSuchMethodError: No interface method toList()Ljava/util/List; in class Ljava/util/stream/Stream; or its super classes (declaration of 'java.util.stream.Stream' appears in /apex/com.android.art/javalib/core-oj.jar) at com.hedera.hashgraph.sdk.ContractFunctionResult.(ContractFunctionResult.java:152) at com.hedera.hashgraph.sdk.ContractCallQuery.mapResponse(ContractCallQuery.java:246) at com.hedera.hashgraph.sdk.ContractCallQuery.mapResponse(ContractCallQuery.java:48) at com.hedera.hashgraph.sdk.Executable$GrpcRequest.mapResponse(Executable.java:929) at com.hedera.hashgraph.sdk.Executable.execute(Executable.java:463) at com.hedera.hashgraph.sdk.Query.execute(Query.java:51) at com.hedera.hashgraph.sdk.Executable.execute(Executable.java:364) at com.hedera.hashgraph.sdk.Query.execute(Query.java:51) at com.mvp.olarawallet.HederaServices.getacontract(HederaServices.java:357) at com.mvp.olarawallet.MainActivity$LogonThread.run(MainActivity.java:251) 2024-06-02 11:29:15.501 10463-10497 Process com.mvp.olarawallet I Sending signal. PID: 10463 SIG: 9

ContractFunctionResult result_1 = new ContractCallQuery() .setGas(5000000) .setContractId(ContractId.fromString(existingcontractid)) .setFunction("getfname") .setMaxQueryPayment(new Hbar(5)) .execute(USER_ACCOUNT);

    if (result_1.errorMessage!= null) {
        System.out.println("Error calling Contract " + result_1.errorMessage);
        return runitdetails;
    }

    String queryout = result_1.getString(0);

Steps to reproduce

droid build. no probs

Additional context

No response

Hedera network

testnet

Version

sdk and gPRC as in the Hedera repo READme - for droid for java sdk

Operating system

None

johnda98 avatar Jun 02 '24 11:06 johnda98