Skip to content

Native.register() not found in android application. #4

@vishalkharat

Description

@vishalkharat

We have followed the steps to integrate library into our application.
But faced with having crash while initialising Hydrogen

Below is the code we tried with

Native.register(Hydrogen.class, "hydrogen");
Hydrogen hydrogen = new Hydrogen();
hydrogen.hydro_init();

// Make a key
byte[] key = new byte[Hydrogen.HYDRO_SIGN_SECRETKEYBYTES];
hydrogen.hydro_secretbox_keygen(key);

// Make a cipher array to hold the resulting encrypted text
byte[] cipher = new byte[Hydrogen.HYDRO_SECRETBOX_HEADERBYTES + 48];
String context = "context1";
byte[] contextBytes = context.getBytes();
String message = "This is a message that will be encrypted.";
byte[] messageBytes = message.getBytes();
long messageId = 1L;

// Now encrypt
int encryptSuccess = hydrogen.hydro_secretbox_encrypt(cipher, messageBytes, messageBytes.length, messageId, contextBytes, key);

Error:
E/zygote64: No implementation found for int co.libly.hydride.Hydrogen.hydro_init()

Can you please let me know how can we get this sorted out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions