# \[Archive\] React Native Android have runtime exception customauth-react-native-sdk@4.0.1

**URL:** <https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [June 7, 2023, 2:08pm UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934 "2023-06-07T14:08:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shazadshiraz97](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@shazadshiraz97](https://builder.metamask.io/u/shazadshiraz97)\
**Post date:** [June 7, 2023, 2:08pm UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/1 "2023-06-07T14:08:30Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **shazadshiraz97** on 6/7/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

Could not invoke RNCustomAuthSdk.init

Failed resolution of:Lorg/bouncycastle/crypto/ec/CustomNamedCurves;

---

<div class="post-metadata">

**Author:** ![yashovardhan](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/yashovardhan/32/1526_2.png) [@yashovardhan](https://builder.metamask.io/u/yashovardhan)\
**Post date:** [June 13, 2023, 6:40am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/2 "2023-06-13T06:40:49Z")

</div>

Hey there,

Have you followed the documentation here for setting up the CustomAuth SDK for Android?

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/4bea15d5fdfd372b2e7fae21263c61fab3da9379.png)

```
  <a href="https://web3auth.io/docs/sdk/core-kit/tkey-react-native/install#configuration-of-project-to-use-customauth-sdk" target="_blank" rel="noopener">web3auth.io</a>

```

### [Installing Core Kit tKey SDK | Documentation](https://web3auth.io/docs/sdk/core-kit/tkey-react-native/install#configuration-of-project-to-use-customauth-sdk)

Web3Auth Core Kit tKey SDK - Installation | Documentation - Web3Auth

---

<div class="post-metadata">

**Author:** ![yashovardhan](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/yashovardhan/32/1526_2.png) [@yashovardhan](https://builder.metamask.io/u/yashovardhan)\
**Post date:** [June 13, 2023, 6:42am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/3 "2023-06-13T06:42:00Z")

</div>

Also please share your implementation code alongside the platform and sdk version so that we’re able to debug and reproduce the error. Most probably, this error is happening due to non configuration of the gradle files.

---

<div class="post-metadata">

**Author:** ![aashiriftikhar](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@aashiriftikhar](https://builder.metamask.io/u/aashiriftikhar)\
**Post date:** [June 13, 2023, 8:05am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/4 "2023-06-13T08:05:47Z")

</div>

We are using the following libs:

“react-native”: “0.66.5”,  
“@toruslabs/customauth-react-native-sdk”: “^4.0.1”  
“@tkey/default”: “^9.0.1”,  
“@tkey/security-questions”: “^9.0.0”,  
“@tkey/share-serialization”: “^9.0.1”,

Android Gradle: 4.2.2

The init code is the following.

```auto
try {
    CustomAuth.init({
      redirectUri: resolvedRedirectUrl,
      browserRedirectUri: 'https://scripts.toruswallet.io/redirect.html',
      network: 'testnet', // details for test net
    });
    const parsedToken = parseIdToken(idToken);
    const verifier = Config.AW_WEB3AUTH_VERIFIER;
    const verifierId = parsedToken.sub;
    const loginDetails = await CustomAuth.getTorusKey(
      verifier,
      verifierId,
      {
        verifierIdField: 'sub',
      },
      idToken,
    );
    tKey.serviceProvider.postboxKey = loginDetails.privateKey;
    (tKey.serviceProvider as any).verifierName = verifier;
    (tKey.serviceProvider as any).verifierId = verifierId;
    await tKey.initialize();
    console.log(
      '2 shares created credentials and device',
      tKey.getKeyDetails(),
    );
    //creating default pin
    if (isRegister) {
      await setTkeyDefaultSecurityQuestion();
    } else {
      //getting share of default pin if not set
      const isDefaultShare = await TkeyIsDefaultSecurityQuestion();
      if (isDefaultShare) {
        getTkeyDefaultSecurityQuestionShare();
      }
    }
  } catch (e) {
    Alert.alert('Error', `Unable to ${isRegister ? 'Register' : 'Login'}`);
  }

```

---

<div class="post-metadata">

**Author:** ![shazadshiraz97](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@shazadshiraz97](https://builder.metamask.io/u/shazadshiraz97)\
**Post date:** [June 13, 2023, 8:50am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/5 "2023-06-13T08:50:15Z")

</div>

Yes we have followed it.

android/build.gradle:

```auto
buildscript {
ext {
	buildToolsVersion = "30.0.3"
	minSdkVersion = project.hasProperty('minSdkVersion') ? project.getProperty('minSdkVersion') : 24
compileSdkVersion = 32
targetSdkVersion = 32

// kotlin_version = “1.5.31”
kotlin_version = “1.6.0”
kotlinVersion = “$kotlin_version”
ndkVersion = “21.4.7075529”
supportLibVersion = “28.0.0”
}
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url “https://jitpack.io” }
}
dependencies {
	classpath('com.android.tools.build:gradle:4.2.2')
	classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
	// NOTE: Do not place your application dependencies here; they belong
	// in the individual module build.gradle files
}

}

```

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://builder.metamask.io/u/gaurav)\
**Post date:** [June 15, 2023, 9:57am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/6 "2023-06-15T09:57:36Z")

</div>

Hey @shazadshiraz97,  
As discussed on call, you have to upgrade android gradle version. Have you tried that?

---

<div class="post-metadata">

**Author:** ![productionsillegal](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@productionsillegal](https://builder.metamask.io/u/productionsillegal)\
**Post date:** [June 15, 2023, 12:29pm UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/7 "2023-06-15T12:29:22Z")

</div>

Hey @gaurav ,  
Ugrading the gradle for whole project is very difficult for us. It would be great if you can help us wo run sdk on lower graddle version as mentioned above.

---

<div class="post-metadata">

**Author:** ![guru](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@guru](https://builder.metamask.io/u/guru)\
**Post date:** [June 16, 2023, 7:09am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/8 "2023-06-16T07:09:34Z")

</div>

can you update the react native to version mentioned in example and try once @shazadshiraz97

---

<div class="post-metadata">

**Author:** ![yashovardhan](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/yashovardhan/32/1526_2.png) [@yashovardhan](https://builder.metamask.io/u/yashovardhan)\
**Post date:** [June 20, 2023, 6:06am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/9 "2023-06-20T06:06:17Z")

</div>

Hey @productionsillegal

We tried internally, but supporting a lower gradle version is not possible from our end. The workaround can be to use the [SFA NodeJS SDK](https://web3auth.io/docs/sdk/core-kit/node/) and use it in place of CustomAuth React Native SDK.

To securely support the process, you can create a public/ private key pair in the frontend. Send the pub key to the backend and encrypt the real key using that and send it back. Now, in the frontend, decrypt the encrypted blob in frontend using the temp private key.

I hope this will resolve the issue.

---

<div class="post-metadata">

**Author:** ![shazadshiraz97](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@shazadshiraz97](https://builder.metamask.io/u/shazadshiraz97)\
**Post date:** [June 20, 2023, 6:47am UTC](https://builder.metamask.io/t/archive-react-native-android-have-runtime-exception-customauth-react-native-sdk-4-0-1/1934/10 "2023-06-20T06:47:26Z")

</div>

@yashovardhan

We have tried that but getting below error in frontend side on android

Response: 403

Url: [https://metadata.tor.us/bulk\_set\_stream](https://metadata.tor.us/bulk_set_stream)

[CoreError: setMetadata errored {“error”:{“index”:0,“timestamp”:“Message has been signed more than 60s ago”},“success”:false}]

and some time below error

[CoreError: getAuthMetadata errored , Custom Signature not valid for returning metadata]
