Cobalt icon indicating copy to clipboard operation
Cobalt copied to clipboard

QR Code not showing for login in terminal

Open NarayanaBoddu opened this issue 7 months ago • 15 comments

Disconnected: LOGGED_OUT

Login QR code not showing in terminal.

Even delete the .cobal folder and tried , but not showing QR.

NarayanaBoddu avatar May 28 '25 02:05 NarayanaBoddu

Pairing code also not getting to app, may be whatsapp detected.

NarayanaBoddu avatar May 28 '25 02:05 NarayanaBoddu

I’m experiencing the same problem and was about to open an issue.

Here are some details about the problem:

  • I can’t even log in or register a new device.
  • It always disconnects with the reason LOGGED_OUT.
  • I always receive a node with description "failure", reason code 405, and the location alternates between rva, odn, cco, lla, cln and frc (those are the ones I could capture).

Note: Web API

ModoloDev avatar May 28 '25 02:05 ModoloDev

Same issue

VincentDevp avatar May 28 '25 03:05 VincentDevp

Well... it's the WhatsApp version. I think 0.0.10 will fix this.

I’m using a workaround until version 0.0.10 is deployed: In version 0.0.9, there’s a class called WhatsappMetadata. In the getWebVersion method (line 54), a request is sent to WhatsApp to retrieve the current version. WhatsApp returns 2.3000.0, so webVersion is set to 2.3000.0, which causes the errors.

What I did was debug the code, place a breakpoint on line 56 of WhatsappMetadata, and set webVersionResponse as new WebVersionResponse(false, true, true, 0, null, "2.3000.1023231279")

That worked.

Image

ModoloDev avatar May 28 '25 03:05 ModoloDev

same problem here

java.lang.RuntimeException: Cannot login: no response from Whatsapp

matheuselmadi avatar May 28 '25 04:05 matheuselmadi

Same here, always disconnects

yeldarsan avatar May 28 '25 07:05 yeldarsan

Same thing here!

piLovr avatar May 28 '25 10:05 piLovr

Well... it's the WhatsApp version. I think 0.0.10 will fix this.

I’m using a workaround until version 0.0.10 is deployed: In version 0.0.9, there’s a class called WhatsappMetadata. In the getWebVersion method (line 54), a request is sent to WhatsApp to retrieve the current version. WhatsApp returns 2.3000.0, so webVersion is set to 2.3000.0, which causes the errors.

What I did was debug the code, place a breakpoint on line 56 of WhatsappMetadata, and set webVersionResponse as new WebVersionResponse(false, true, true, 0, null, "2.3000.1023231279")

That worked.

Image

Fixed for me!

Great temporary solution for those able to build the project.

vitorhugoze avatar May 28 '25 13:05 vitorhugoze

I fix it changing the device of the store of my Whatsapp object before connect whatsapp.store().setDevice(CompanionDevice.web(Version.of("2.3000.1023231279")));

Well... it's the WhatsApp version. I think 0.0.10 will fix this.

I’m using a workaround until version 0.0.10 is deployed: In version 0.0.9, there’s a class called WhatsappMetadata. In the getWebVersion method (line 54), a request is sent to WhatsApp to retrieve the current version. WhatsApp returns 2.3000.0, so webVersion is set to 2.3000.0, which causes the errors.

What I did was debug the code, place a breakpoint on line 56 of WhatsappMetadata, and set webVersionResponse as new WebVersionResponse(false, true, true, 0, null, "2.3000.1023231279")

That worked.

Image

asanchezbeyond avatar May 29 '25 08:05 asanchezbeyond

Just as a note.

I tested using the most recent changes of this repository and this issue is now fixed.

0.0.10 Commits solved this.

vitorhugoze avatar May 29 '25 11:05 vitorhugoze

I fix it changing the device of the store of my Whatsapp object before connect whatsapp.store().setDevice(CompanionDevice.web(Version.of("2.3000.1023231279")));

Well... it's the WhatsApp version. I think 0.0.10 will fix this. I’m using a workaround until version 0.0.10 is deployed: In version 0.0.9, there’s a class called WhatsappMetadata. In the getWebVersion method (line 54), a request is sent to WhatsApp to retrieve the current version. WhatsApp returns 2.3000.0, so webVersion is set to 2.3000.0, which causes the errors. What I did was debug the code, place a breakpoint on line 56 of WhatsappMetadata, and set webVersionResponse as new WebVersionResponse(false, true, true, 0, null, "2.3000.1023231279") That worked. Image

Thanks! I didn't know that

ModoloDev avatar May 29 '25 14:05 ModoloDev

I fix it changing the device of the store of my Whatsapp object before connect whatsapp.store().setDevice(CompanionDevice.web(Version.of("2.3000.1023231279")));

This works!

For older versions (Whatsappweb4j) you can set the version on the Options class:

var options = Whatsapp.Options.newOptions() .version(Version.builder().primary(2).secondary(3000).tertiary(1023231279).build()) .build();

Whatsapp.newConnection(options).connect()

GDB4J avatar May 29 '25 18:05 GDB4J

this is fixed in 0.0.10, but i haven't released it yet

Auties00 avatar May 29 '25 19:05 Auties00

Good evening everyone, I took a look at the previous comments. Has anyone managed to solve this using the Whatsapp.webBuilder() constructor?

I can't solve the version and I need the QrCode because I pass it via URI request.

Thank you very much to anyone who can help me.

    Whatsapp.webBuilder()
            .firstConnection()
            .name("CMCE LOGIN NÃO DESCONECTE")
            .mediaProxySetting(MediaProxySetting.NONE)
            .automaticMessageReceipts(false)
            .textPreviewSetting(TextPreviewSetting.DISABLED)
            .historySetting(WebHistorySetting.discard(true))
            .autodetectListeners(true)
            .unregistered(qrCode -> {
                System.out.println("QRCodeRecebido");
                this.qrCode = qrCode;

            })
            .addLoggedInListener(api -> {
                whatsappFuture.complete(api);
                System.out.printf("conectado: %s%n", api.store().privacySettings());
                isDisconnecting = false;

            })
            .addDisconnectedListener(reason -> {
                whatsappFuture = new CompletableFuture<>();
                System.out.printf("disconectado: %s%n", reason);
            }).connect();

DiogenesSSantos avatar May 30 '25 23:05 DiogenesSSantos

Good evening everyone, I took a look at the previous comments. Has anyone managed to solve this using the Whatsapp.webBuilder() constructor?

I can't solve the version and I need the QrCode because I pass it via URI request.

Thank you very much to anyone who can help me.

    Whatsapp.webBuilder()
            .firstConnection()
            .name("CMCE LOGIN NÃO DESCONECTE")
            .mediaProxySetting(MediaProxySetting.NONE)
            .automaticMessageReceipts(false)
            .textPreviewSetting(TextPreviewSetting.DISABLED)
            .historySetting(WebHistorySetting.discard(true))
            .autodetectListeners(true)
            .unregistered(qrCode -> {
                System.out.println("QRCodeRecebido");
                this.qrCode = qrCode;

            })
            .addLoggedInListener(api -> {
                whatsappFuture.complete(api);
                System.out.printf("conectado: %s%n", api.store().privacySettings());
                isDisconnecting = false;

            })
            .addDisconnectedListener(reason -> {
                whatsappFuture = new CompletableFuture<>();
                System.out.printf("disconectado: %s%n", reason);
            }).connect();

you can do like that

Whatsapp wl=  Whatsapp.webBuilder()
           .firstConnection()
           .name("CMCE LOGIN NÃO DESCONECTE")
           .mediaProxySetting(MediaProxySetting.NONE)
           .automaticMessageReceipts(false)
           .textPreviewSetting(TextPreviewSetting.DISABLED)
           .historySetting(WebHistorySetting.discard(true))
           .autodetectListeners(true)
           .unregistered(qrCode -> {
               System.out.println("QRCodeRecebido");
               this.qrCode = qrCode;

           })
           .addLoggedInListener(api -> {
               whatsappFuture.complete(api);
               System.out.printf("conectado: %s%n", api.store().privacySettings());
               isDisconnecting = false;

           })
           .addDisconnectedListener(reason -> {
               whatsappFuture = new CompletableFuture<>();
               System.out.printf("disconectado: %s%n", reason);
           });          
           wl.store().setDevice(CompanionDevice.web(Version.of("2.3000.1023231279")));
           wl.connect() // Connect to Whatsapp asynchronously
                   .join() // Await the result
                   .awaitDisconnection();

juniorsudrv avatar May 31 '25 11:05 juniorsudrv

fixed in 0.0.10

Auties00 avatar Jul 20 '25 15:07 Auties00