# Can not initialize Android SDK

**URL:** <https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791>\
**Category:** Android\
**Created:** [June 20, 2021, 4:23pm UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791 "2021-06-20T16:23:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shpy2001](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shpy2001/32/3536_2.png) [@shpy2001](https://devforum.zoom.us/u/shpy2001)\
**Post date:** [June 20, 2021, 4:23pm UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791/1 "2021-06-20T16:23:33Z")

</div>

**Description**

- With app SDK Credentials

- With app JWT Credentials:

- In all error cases , if try to init again , there is no return.

**Which Android Client SDK version?**  
v5.5.1.1319

Payload from [jwt.io](http://jwt.io)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/6/261cccdf4ceb17bf5bd05c7e1161be1fbf622d75.png)

---

<div class="post-metadata">

**Author:** ![shpy2001](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shpy2001/32/3536_2.png) [@shpy2001](https://devforum.zoom.us/u/shpy2001)\
**Post date:** [June 21, 2021, 4:03am UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791/2 "2021-06-21T04:03:27Z")

</div>

I found:

- Must use SDK app credentials to generate JWT. Can not user JWT app credentials on Android app.
- “tokenExp” = “exp” = “iat” + [seconds]
- iat must \< current\_time.

It can init some time. After that, ErrorCode = 1 and Internal ErrorCode = 0 because of tokenExp and exp had expired. Why doesnt onZoomAuthIdentityExpired fire ?!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 21, 2021, 7:19pm UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791/3 "2021-06-21T19:19:25Z")

</div>

Hi @shpy2001, thanks for the post.

When you are generating the JWT, are you using the same key and secret as when you are when initializing with the raw key/secret values? You mention API key + API secret, so I suspect that may be the issue. The SDK only accepts SDK credentials for initialization.

Thanks!

---

<div class="post-metadata">

**Author:** ![shpy2001](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shpy2001/32/3536_2.png) [@shpy2001](https://devforum.zoom.us/u/shpy2001)\
**Post date:** [June 22, 2021, 1:37am UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791/4 "2021-06-22T01:37:48Z")

</div>

Hi @jon.zoom thank for your support.  
I had confused between SDK app credentials and JWT app credentials.  
Yes, for mobile app, must use SDK app credentials to generate jwt token.  
It can work now. But when token expired, it return error 1 too. I think it must fire onZoomAuthIdentityExpired ?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 22, 2021, 4:54pm UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791/5 "2021-06-22T16:54:41Z")

</div>

Hi @shpy2001,

Glad to hear it’s working with the correct credentials!

Regarding the JWT expiring, that depends on which type of expiration is happening. If you are reusing the same JWT multiple times in a session, reaching the `exp` field’s time will cause auth attempts to fail, as that represents when the JWT itself expires.

On the other hand, the `tokenExp` field represents when your authentication session expires, and should trigger the callback you mentioned.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 23, 2021, 2:55am UTC](https://devforum.zoom.us/t/can-not-initialize-android-sdk/52791/6 "2021-07-23T02:55:07Z")

</div>

Closed on July 23, 2021, 2:55am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
