Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
625 stars 183 forks source link

NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf() #344

Closed dgonzalez211 closed 1 year ago

dgonzalez211 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS

I'm running a simple test code to make a connection:

    public static void main(String... args) {
        // Create a new instance of WhatsappAPI
        Whatsapp.webBuilder()
                .newConnection()
                .build()
                .addLoggedInListener(() -> System.out.println("Connected!"))
                .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
                .connectAndAwait()
                .join();
    }

}

and then this error appears:

```Exception in thread "main" java.util.concurrent.CompletionException: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
    at it.auties.whatsapp.model.request.Request.of(Request.java:72)
    at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
    at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
    ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at java.base/java.lang.Class.getMethod(Class.java:2227)
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
    ... 10 more

Process finished with exit code 1
Kyuugeki commented 1 year ago

Same problem here Does anybody have any clue?

Auties00 commented 1 year ago

Go in your ide settings and enable Delegate build actions to maven

dgonzalez211 commented 1 year ago

Not working with that option enabled, keeps the same error:

image image

Any clues?