Unable to run example2 of Video SDK v5.7.1.1268

Description
I am just trying to run example2 of the Android SDK, but I am facing lots of issues. I am very new to Zoom SDK. Please help me how to resolve this.

Which Android Video SDK version?
v5.7.1.1268

To Reproduce(If applicable)
Just download v5.7.1.1268 of Android SDK and load it in Android Studio and try to run it.

Screenshots

The screenshot shows all the errors. I thought, I don’t need any of those, so commented and tried to run. It ran, and showed a window with Welcome, Page 2, and Meeting. When I clicked on Meeting, it is throwing an error “ZoomSDK has not been initialized successfully”.

I thought it is the issue with the SDK_JWTTOKEN in Constants.java file. Hence, I tried to give appKey and appSecret in ZoomSDKInitParams of MainActivity. Still getting the same error.
I generated SDK_JWTTOKEN from https://jwt.io, by giving
{
“appKey”: “<SDK_KEY_FROM_APP_MARKETPLACE>”,
“iat”: 1632939022,
“exp”: 1635939022,
“tokenExp”: 1635939022
}

I am not getting where I am going wrong. Please someone help me.

Hi @developerskreedaloka, thanks for using our SDK.

Please note that I have moved this topic over to #mobile-meeting-sdk:android. :slightly_smiling_face:

Thanks for pointing this out. It seems that we did not properly update that module to adapt to the breaking changes introduced in 5.71. We can definitely work on getting those changes made in a future release, but in the meantime it should be a relatively simple task to make the necessary changes locally. Our release notes should contain all of the information you need to migrate to the correct methods, but please let me know if anything is missing or unclear and I will be more than happy to help.

Thanks!

Thank you jon.lieblich for your response.

Thanks for moving the topic to the right place :grinning_face_with_smiling_eyes:

Now my problem is, even when I tried with the SDK version v5.5.1.1319, I am getting an error as “ZoomSDK has not been initialized successfully”. May be, I am doing something wrong in generating the SDK_JWTTOKEN or something. But not sure what. Please help me.

Hi @developerskreedaloka,

Can you please provide the error code you are seeing when the SDK fails to initialize?

Thanks!

Hi @jon.zoom

Here is the logcat logs I got from the launch till I click on Meeting. Unable to find anything here. Let me know if you want me to put logs somewhere.

I had put the command like this:
adb logcat | grep “zoom”

09-30 23:14:27.025 4718 4718 D Launcher.ItemClickHandler: onClick, tag = AppInfo(@9ca50a8id=-1 type=APP container=-1 screen=-1 cell(-1,-1) span(1,1) minSpan(1,1) rank=0 user=UserHandle{0} title=Zoom SDK example2 installStateType=-1 installSource=null component=ComponentInfo{us.zoom.sdkexample2/us.zoom.sdkexample2.MainActivity}, update=false, limit=false, runtime=110000000 componentName = ComponentInfo{us.zoom.sdkexample2/us.zoom.sdkexample2.MainActivity})
09-30 23:14:27.031 1752 5721 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=us.zoom.sdkexample2/.MainActivity bnds=[564,1290][700,1512] mCallingUid=10090} from uid 10090 and from pid 4718
09-30 23:14:27.278 1752 2114 D WindowManager: Add to mViews: DecorView@c336635[sdkexample2], this = android.view.WindowManagerGlobal@32b6f20,pkg= us.zoom.sdkexample2
09-30 23:14:27.321 1752 2114 D OppoDisplayPolicy: us.zoom.sdkexample2, no change cutoutMode: 0
09-30 23:14:27.336 1752 2114 D OppoDisplayPolicy: us.zoom.sdkexample2, no change cutoutMode: 0
09-30 23:14:27.340 992 1105 D DispPerfService: get proc=Splash Screen us.zoom.sdkexample2#0 none
09-30 23:14:27.353 992 2259 D DispPerfService: onframeavailable pid=1752, slot=0, seq=6220, ret=0, name=system_server:Splash Screen us.zoom.sdkexample2#0
09-30 23:14:27.372 1752 2114 I ColorAppSwitchManagerService: handleAppVisible , r = ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.372 1752 2114 V ColorZoomWindowManagerService: onAnimationFinished: r=ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.372 1752 2114 I ColorAppSwitchManagerService: handleAppVisible , r = ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.479 1752 2187 I ActivityManager: Start proc 30902:us.zoom.sdkexample2/u0a239 for activity {us.zoom.sdkexample2/us.zoom.sdkexample2.MainActivity}
09-30 23:14:27.752 1752 6412 V ColorZoomWindowManagerService: onAnimationFinished: r=ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.759 1752 6412 I ColorAppSwitchManagerService: appswitch hasProcess ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.760 1752 6412 I ColorAppSwitchManagerService: appswitch hasProcess ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.760 1752 6412 I ColorZoomWindowManagerService: topResumedActivityChanged start r = ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.762 1752 6412 W ColorAccessControlManagerService: notifyZoomWindowExit: stack=ActivityStack{5a95f6a stackId=64 type=standard mode=fullscreen visible=true translucent=false, 1 tasks} windowMode=1 topActivity=ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359} toFullScreen = true
09-30 23:14:27.765 4936 15401 D ZoomAppController: ZoomAppPresenter onZoomWindowHide, info = ColorZoomWindowInfo = { pName = rotation = 1 shown = false lockPkg = null zoomRect = Rect(80, 9 - 547, 711) lockUserId = 0 zoomUserId = 0 inputShow = false cpnName = null lastExitMethod = -1 inputMethodType = 0 extension = Bundle[EMPTY_PARCEL]}
09-30 23:14:27.770 3017 3038 I DCS-BackgroundAppData: sendAppBgEvent: has no pkgName=us.zoom.sdkexample2
09-30 23:14:27.771 1752 6412 V ColorZoomWindowManagerService: onAnimationFinished: r=ActivityRecord{d380b3f u0 us.zoom.sdkexample2/.MainActivity t3359}
09-30 23:14:27.790 1752 11778 E OppoThermalStats: Error getting package info: us.zoom.sdkexample2
09-30 23:14:27.807 1752 2113 D OppoOomAjusterHelper: TOP_APP is ProcessRecord{d00fc9c 30902:us.zoom.sdkexample2/u0a239} uid is 10239
09-30 23:14:27.812 1752 2113 D BatteryStatsImpl: noteActivityResumedLocked pkg:us.zoom.sdkexample2
09-30 23:14:27.815 5704 9383 E oiface : packageSwitch pkg us.zoom.sdkexample2, enter
09-30 23:14:27.816 5704 9383 E oiface : current package is us.zoom.sdkexample2
09-30 23:14:27.850 5704 5717 D oiface : forground package is us.zoom.sdkexample2
09-30 23:14:29.008 30902 30902 I ZoomSDK : initialize context is us.zoom.sdkexample2.MainActivity@6ece2bc
09-30 23:14:29.201 30902 30902 I chatty : uid=10239(us.zoom.sdkexample2) identical 1 line
09-30 23:14:29.535 30902 30902 I AudioManager: In isBluetoothScoOn(), calling application: us.zoom.sdkexample2
09-30 23:14:30.077 30902 30902 D WindowManager: Add to mViews: DecorView@92d1813[MainActivity], this = android.view.WindowManagerGlobal@73b3a50,pkg= us.zoom.sdkexample2
09-30 23:14:30.089 1752 4782 D OppoDisplayPolicy: us.zoom.sdkexample2, no change cutoutMode: 0
09-30 23:14:30.127 1752 4782 D OppoDisplayPolicy: us.zoom.sdkexample2, no change cutoutMode: 0
09-30 23:14:30.131 992 1649 D DispPerfService: get proc=us.zoom.sdkexample2/us.zoom.sdkexample2.MainActivity#0 none
09-30 23:14:30.132 1752 4782 V WindowManager: Changing focus from null to Window{565ab7 u0 us.zoom.sdkexample2/us.zoom.sdkexample2.MainActivity} displayId=0
09-30 23:14:30.184 992 1649 D DispPerfService: onframeavailable pid=30902, slot=2, seq=6234, ret=0, name=us.zoom.sdkexample2:us.zoom.sdkexample2/us.zoom.sdkexample2.MainActivity#0
09-30 23:14:30.206 1752 2151 I ActivityTaskManager: Displayed us.zoom.sdkexample2/.MainActivity: +3s169ms
09-30 23:14:30.223 992 992 D SurfaceFlinger: Client::detachLayer this 0x7af348f6c0, layer sequence 6220 Splash Screen us.zoom.sdkexample2#0
09-30 23:14:30.223 992 992 D SurfaceFlinger: Client::detachLayer this 0x7af348f6c0, layer sequence 6219 7f6e43b Splash Screen us.zoom.sdkexample2#0
09-30 23:15:02.685 30902 30902 D WindowManager: Add to mViews: com.color.internal.widget.ColorToastLayout{d6b855f V.E… …I. 0,0-0,0 #c0204f9 oppo:id/color_toast_layout}, this = android.view.WindowManagerGlobal@73b3a50,pkg= us.zoom.sdkexample2
09-30 23:15:02.691 1752 6412 D OppoDisplayPolicy: us.zoom.sdkexample2, no change cutoutMode: 0
09-30 23:15:02.715 1752 11778 D OppoDisplayPolicy: us.zoom.sdkexample2, no change cutoutMode: 0
09-30 23:15:02.737 992 1665 D DispPerfService: onframeavailable pid=30902, slot=2, seq=6237, ret=0, name=us.zoom.sdkexample2:Toast#0
09-30 23:15:06.220 1752 4782 W NotificationService: Toast already killed. pkg=us.zoom.sdkexample2 callback=android.app.ITransientNotification$Stub$Proxy@820c7b1

Hi @developerskreedaloka,

The initialize result is not included in those logs. When the SDK initialize result callback is triggered, you will see the error code in a Toast on your device. Can you please provide the error code so that I can further assist?

Thanks!

Hi @jon.zoom

This is what I got
11499-11499/us.zoom.sdkexample2 I/Zoom SDK Example: onZoomSDKInitializeResult, errorCode=5, internalErrorCode=124

Hi @developerskreedaloka,

This error code indicates that the token used was invalid. Can you please provide the structure of the JWT payload you are using? Be sure to exclude any developer credentials.

Thanks!

Hi @jon.zoom

I went to https://jwt.io and there is an option to upload “Payload: Data”. There, I entered the below thing:
{
“appKey”: “<SDK_KEY_FROM_APP_MARKETPLACE>”,
“iat”: 1632939022,
“exp”: 1635939022,
“tokenExp”: 1635939022
}

And it gave one string in the ENCODED panel of the left side. I copied that and used it as SDK_JWTTOKEN.

Hi @jon.zoom

Did you get a chance to check what I am missing? :slight_smile:

Hi @developerskreedaloka,

Based on the timestamps you have provided, it seems that the expiration time is being set too far in the future. As noted in our documentation, the exp field has a max value of iat + 172800 (i.e. 48 hours after the iat value). The tokenExp does not have a max value, but we do not recommend setting this to an extremely long window for security purposes.

Please let me know if you are still seeing any issues after decreasing the expiration window.

Thanks!

Hi @jon.zoom

Now I changed the payload to this:
{
“appKey”: “<SDK_KEY_FROM_APP_MARKETPLACE>”,
“iat”: 1633409022,
“exp”: 1633539022,
“tokenExp”: 1633539022
}

Still, same issue.
Zoom SDK Example: onZoomSDKInitializeResult, errorCode=5, internalErrorCode=124

Hi @developerskreedaloka,

When you create the JWT, are you sure that you are copying the key and secret over to the correct places in the JWT?

Thanks!

Hi @jon.zoom

I didn’t understand properly. Because, what I am doing is, just visiting the https://jwt.io website and pasting the payload which I had sent and putting the ENCODED string to SDK_JWTTOKEN in the Constants.java file and running. I am using SDK Key from Marketplace in generating the JWTTOKEN, but I am not using the secret anywhere else. Please guide me.

Hi @developerskreedaloka,

When you create a JWT, you must include the SDK secret in the signature. There are three components to a JWT: the header, payload, and signature. Each of these are in their own text box on jwt.io. Please ensure that your secret is pasted into the section of the signature labeled as your-256-bit-secret.

Screen Shot 2021-10-06 at 11.40.55 AM

Thanks!

Hi @jon.zoom

It worked like charm now. Thanks for noting it down.

Glad to hear it’s working!

Please don’t hesitate to reach back out in a new topic if you have any additional questions. :slightly_smiling_face:

Hi @jon.zoom

Sure. Happy to see a wonderful helping person in the Zoom team. :slight_smile:

1 Like

Thank you for the kind words, always happy to help!