# Flutter: zoom sdk android failed to initialize

**URL:** <https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289>\
**Category:** Meeting SDK\
**Tags:** android, jwt\
**Created:** [February 21, 2024, 9:27am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289 "2024-02-21T09:27:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![fauzi.nur21](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fauzi.nur21/32/56816_2.png) [@fauzi.nur21](https://devforum.zoom.us/u/fauzi.nur21)\
**Post date:** [February 21, 2024, 9:27am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/1 "2024-02-21T09:27:50Z")

</div>

Hello, I’m trying to implement zoom sdk version 5.16.10.17706 and always failed to initialize the SDK on android

Here’s I create jwtToken on flutter

```auto
    String token;
    var timeStamp = today;
    final exp = timeStamp.add(Duration(minutes: 30)).millisecondsSinceEpoch;

    /* Sign */ {
      // Create a json web token
      final jwt = JWT(
        {
          "appKey": Env.ZOOM_KEY,
          "iat": timeStamp.millisecondsSinceEpoch,
          "exp": exp,
          "tokenExp": exp
        },
        header: {
          "alg": "HS256",
          "typ": "JWT"
        }
        // issuer: 'https://github.com/jonasroussel/dart_jsonwebtoken',
      );

      // Sign it
      token = jwt.sign(SecretKey(Env.ZOOM_SECRET));

      printWrapped('Signed token: $token\n');
    }

```

and here’s is the code to init the SDK on native android

```auto
private fun initSDK(call: MethodCall, result : MethodChannel.Result) {
        Utils.setLog(this, "initSDK: ${call.arguments}")

        val params = ZoomSDKInitParams().apply {
            domain = "zoom.us"
            enableLog = true
            jwtToken = call.argument("jwt") ?: ""
// appKey = call.argument("zoomKey") ?: ""
// appSecret = call.argument("zoomSecret") ?: ""
        }

        sdk.initialize(this, ZoomSDKListener(), params)
        result.success(true)
        return
    }

```

but on the zoom SDK listener always failed to initialize SDK errorCode: 1 , internalErrorCode:0.

edit: I used

```auto
dart_jsonwebtoken: ^2.8.0

```

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [February 22, 2024, 1:15am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/2 "2024-02-22T01:15:03Z")

</div>

Thank you for posting in the Zoo Developer Forum. I recommend referencing the Sample Auth Meeting app and comparing it with your implementation. You can use this app to generate a token and hardcode it to ensure it functions as expected. From there, you can compare the signed token with yours. Here is the sample app for reference:

> **[GitHub - zoom/meetingsdk-auth-endpoint-sample: Generate a Meeting SDK JWT to...](https://github.com/zoom/meetingsdk-auth-endpoint-sample)**
>
> Generate a Meeting SDK JWT to join Zoom meetings and webinars with the Meeting SDK. - zoom/meetingsdk-auth-endpoint-sample

---

<div class="post-metadata">

**Author:** ![fauzi.nur21](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fauzi.nur21/32/56816_2.png) [@fauzi.nur21](https://devforum.zoom.us/u/fauzi.nur21)\
**Post date:** [February 22, 2024, 2:32am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/3 "2024-02-22T02:32:09Z")

</div>

I’m sorry it’s confusing, the previous version I used is 5.13.5.11583 and in this version, I only used **app key** and **secret key** to initialize ZoomSDK, but recently the initialize has success but the user cannot join the meeting.

Status from `MeetingServiceListener` is connecting and then disconnected, so when I asked the support they said to upgrade the version of Zoom that I used.

So I tried to upgrade to 5.16.10.17706 but it doesn’t use the `app key` and `secret key` anymore to init the SDK instead using JWTtoken and I tried to generate using a plugin in Flutter and yes it failed.

From your recommendation, it means I have to generate it from the server right?

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [February 22, 2024, 3:05am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/4 "2024-02-22T03:05:20Z")

</div>

@fauzi.nur21,

Correct, you could generate the JWT from the server side and hardcode it to determine if you can join successfully. This approach will assist in identifying any potential issues with your current implementation.

---

<div class="post-metadata">

**Author:** ![fauzi.nur21](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fauzi.nur21/32/56816_2.png) [@fauzi.nur21](https://devforum.zoom.us/u/fauzi.nur21)\
**Post date:** [February 22, 2024, 9:54am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/5 "2024-02-22T09:54:58Z")

</div>

Ok, I will try it.

But why did they remove `appKey` and `appSecret` on the latest version?

---

<div class="post-metadata">

**Author:** ![mjthirutj13](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mjthirutj13/32/49720_2.png) [@mjthirutj13](https://devforum.zoom.us/u/mjthirutj13)\
**Post date:** [February 28, 2024, 9:39am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/6 "2024-02-28T09:39:26Z")

</div>

I’m also facing the same problem for the week with the same zoom sdk version. Have you tried to create the JWT from the server side? … and if so, will it work correctly for you?

---

<div class="post-metadata">

**Author:** ![mjthirutj13](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mjthirutj13/32/49720_2.png) [@mjthirutj13](https://devforum.zoom.us/u/mjthirutj13)\
**Post date:** [February 28, 2024, 9:48am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/7 "2024-02-28T09:48:09Z")

</div>

I’m tried to create a access token from the postman(Server to server OAuth method) and hardcoded with flutter code. I’m facing the same issue errorCode: 1 , internalErrorCode: 0.

Is JWT has deprecated ?  
Should we needed to use server to server OAuth for authentication before inialize zoom sdk?

---

<div class="post-metadata">

**Author:** ![fauzi.nur21](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fauzi.nur21/32/56816_2.png) [@fauzi.nur21](https://devforum.zoom.us/u/fauzi.nur21)\
**Post date:** [February 28, 2024, 9:53am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/8 "2024-02-28T09:53:11Z")

</div>

@mjthirutj13 yes it work with JWT token from the server side. Big thanks to @donte.zoom

---

<div class="post-metadata">

**Author:** ![mjthirutj13](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mjthirutj13/32/49720_2.png) [@mjthirutj13](https://devforum.zoom.us/u/mjthirutj13)\
**Post date:** [February 28, 2024, 10:19am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/9 "2024-02-28T10:19:08Z")

</div>

Seems in the document, they have mentioned like JWT token method has deprecated whereas can we use it? …

I tried online generated JWT token and hardcoded to initialize app, but the error comes like errorCode: 1 , internalErrorCode: 124

_Code :_

val sdk = ZoomSDK.getInstance()

```
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
    super.configureFlutterEngine(flutterEngine)
    MethodChannel(
            flutterEngine.dartExecutor.binaryMessenger,
            CHANNEL
    ).setMethodCallHandler { call, result ->
        if (call.method == "initializeZoomSDK") {
            JWT_TOKEN = call.argument<String>("JWToken");
            println("TOKEN $JWT_TOKEN")
            initialiseSDK()
        } else if (call.method == "joinMeeting") {
            MEETINGID = call.argument<String>("meetingID");
            PASSCODE = call.argument<String>("meetingPasscode");
            joinMeeting()
        } else if (call.method == "startMeeting") {
            MEETINGID = call.argument<String>("meetingID");
            startMeeting()
        } else {
            result.notImplemented()
        }
    }
}

private fun initialiseSDK() {
    println("calling native method")
    val initParams = ZoomSDKInitParams()
    initParams.jwtToken = JWT_TOKEN
    initParams.enableLog = true
    initParams.domain = "zoom.us"
    sdk.initialize(context, this, initParams)
}

```

---

<div class="post-metadata">

**Author:** ![fauzi.nur21](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fauzi.nur21/32/56816_2.png) [@fauzi.nur21](https://devforum.zoom.us/u/fauzi.nur21)\
**Post date:** [February 29, 2024, 1:47am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/10 "2024-02-29T01:47:23Z")

</div>

I think your generated JWT is wrong, have you tried to create it from the server side and follow the documentation mentioned by @donte.zoom

---

<div class="post-metadata">

**Author:** ![mjthirutj13](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mjthirutj13/32/49720_2.png) [@mjthirutj13](https://devforum.zoom.us/u/mjthirutj13)\
**Post date:** [February 29, 2024, 5:48am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/11 "2024-02-29T05:48:49Z")

</div>

Sure, I’ll try with server side and coming back to here. Thanks @fauzi.nur21

---

<div class="post-metadata">

**Author:** ![bens1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bens1/32/12585_2.png) [@bens1](https://devforum.zoom.us/u/bens1)\
**Post date:** [February 29, 2024, 6:09am UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/12 "2024-02-29T06:09:22Z")

</div>

Replying because I’m interested in getting Zoom into my flutter app.

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [March 4, 2024, 9:17pm UTC](https://devforum.zoom.us/t/flutter-zoom-sdk-android-failed-to-initialize/104289/13 "2024-03-04T21:17:36Z")

</div>

Hey, @bens1 and @mjthirutj13 ,

To clarify, Zoom does not offer an official Flutter Meeting SDK. They do provide a Video SDK for Flutter, but not specifically for meetings. Perhaps @fauzi.nur21 can share more about the Flutter Meeting SDK he used.
