I am facing NullPointerException when I going to initialize a meeting by passcode and meeting code, by following the official GitHub sample app.
First, I have faced, ClassNotFoundException, which says com.google.android.flexbox.FlexBox is not found in the dex path list. so I have fixed it by adding the dependancy implementation 'com.google.android.flexbox:flexbox:3.0.0'
After this, I have faced this exception: Attaching full log for better understanding the issue:
$ adb shell am start -n "com.methewlive.app/com.methewlive.app.SplashScreen" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3121 on device 'Pixel_3a_XL_API_22 [emulator-5554]'.
E/libprocessgroup: failed to make and chown /acct/uid_10071: Read-only file system
W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
I/art: Not late-enabling -Xcheck:jni (already on)
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/: HostConnection::get() New Host Connection established 0xb425bc90, tid 3121
D/Atlas: Validating map...
D/: HostConnection::get() New Host Connection established 0xae8c81a0, tid 3141
I/OpenGLRenderer: Initialized EGL, version 1.4
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xae834880: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/OpenGLRenderer: Enabling debug mode 0
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
I/System.out: all permission is granted.
W/linker: Unsupported flags DT_FLAGS_1=0x9
libcrypto_sb.so: unused DT entry: type 0x6ffffffe arg 0x30c00
libcrypto_sb.so: unused DT entry: type 0x6fffffff arg 0x2
Unsupported flags DT_FLAGS_1=0x9
libssl_sb.so: unused DT entry: type 0x6ffffffe arg 0xa700
W/linker: libssl_sb.so: unused DT entry: type 0x6fffffff arg 0x2
libcmmlib.so: unused DT entry: type 0x6ffffffe arg 0x16118
libcmmlib.so: unused DT entry: type 0x6fffffff arg 0x3
W/linker: libzoom_util.so: unused DT entry: type 0x6ffffffe arg 0x159bc
libzoom_util.so: unused DT entry: type 0x6fffffff arg 0x1
E/BluetoothAdapter: Bluetooth binder is null
W/linker: libzoom_tp.so: unused DT entry: type 0x6ffffffe arg 0xe190
libzoom_tp.so: unused DT entry: type 0x6fffffff arg 0x4
W/linker: libzWebService.so: unused DT entry: type 0x6ffffffe arg 0xcacc
libzWebService.so: unused DT entry: type 0x6fffffff arg 0x4
W/linker: libzoom.so: unused DT entry: type 0x6ffffffe arg 0x4754
libzoom.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libzChatApp.so: unused DT entry: type 0x6ffffffe arg 0x1575c
libzChatApp.so: unused DT entry: type 0x6fffffff arg 0x3
W/linker: libzChatUI.so: unused DT entry: type 0x6ffffffe arg 0x1df18
W/linker: libzChatUI.so: unused DT entry: type 0x6fffffff arg 0x1
W/linker: libzLoader.so: unused DT entry: type 0x6ffffffe arg 0x2ad8
libzLoader.so: unused DT entry: type 0x6fffffff arg 0x2
libzData.so: unused DT entry: type 0x6ffffffe arg 0x3f2c
libzData.so: unused DT entry: type 0x6fffffff arg 0x3
W/OpenSSL-keystore-rsa: No valid signature returned
W/OpenSSL-keystore-rsa: No valid signature returned
E/BluetoothAdapter: Bluetooth binder is null
E/BluetoothAdapter: Bluetooth binder is null
I/Choreographer: Skipped 43 frames! The application may be doing too much work on its main thread.
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/EGL_emulation: eglMakeCurrent: 0xae834880: ver 2 0 (tinfo 0xae839390)
D/AndroidRuntime: Shutting down VM
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.methewlive.app, PID: 3121
java.lang.NullPointerException: Attempt to invoke interface method 'int us.zoom.sdk.MeetingService.joinMeetingWithParams(android.content.Context, us.zoom.sdk.JoinMeetingParams, us.zoom.sdk.JoinMeetingOptions)' on a null object reference
at com.methewlive.app.activities.Test.joinMeeting(Test.java:131)
at com.methewlive.app.activities.Test$5.onClick(Test.java:176)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I/Process: Sending signal. PID: 3121 SIG: 9
Connected to process 3272 on device 'Pixel_3a_XL_API_22 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/: HostConnection::get() New Host Connection established 0xb425b8d0, tid 3272
D/Atlas: Validating map...
D/: HostConnection::get() New Host Connection established 0xb43ff1f0, tid 3289
I/OpenGLRenderer: Initialized EGL, version 1.4
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xb429a1c0: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xb429a1c0: ver 2 0 (tinfo 0xb4235bd0)
D/OpenGLRenderer: Enabling debug mode 0
D/EGL_emulation: eglMakeCurrent: 0xb429a1c0: ver 2 0 (tinfo 0xb4235bd0)
I/System.out: all permission is granted.
W/linker: Unsupported flags DT_FLAGS_1=0x9
libcrypto_sb.so: unused DT entry: type 0x6ffffffe arg 0x30c00
libcrypto_sb.so: unused DT entry: type 0x6fffffff arg 0x2
Unsupported flags DT_FLAGS_1=0x9
W/linker: libssl_sb.so: unused DT entry: type 0x6ffffffe arg 0xa700
libssl_sb.so: unused DT entry: type 0x6fffffff arg 0x2
libcmmlib.so: unused DT entry: type 0x6ffffffe arg 0x16118
libcmmlib.so: unused DT entry: type 0x6fffffff arg 0x3
W/linker: libzoom_util.so: unused DT entry: type 0x6ffffffe arg 0x159bc
libzoom_util.so: unused DT entry: type 0x6fffffff arg 0x1
E/BluetoothAdapter: Bluetooth binder is null
W/linker: libzoom_tp.so: unused DT entry: type 0x6ffffffe arg 0xe190
libzoom_tp.so: unused DT entry: type 0x6fffffff arg 0x4
W/linker: libzWebService.so: unused DT entry: type 0x6ffffffe arg 0xcacc
libzWebService.so: unused DT entry: type 0x6fffffff arg 0x4
W/linker: libzoom.so: unused DT entry: type 0x6ffffffe arg 0x4754
libzoom.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libzChatApp.so: unused DT entry: type 0x6ffffffe arg 0x1575c
libzChatApp.so: unused DT entry: type 0x6fffffff arg 0x3
W/linker: libzChatUI.so: unused DT entry: type 0x6ffffffe arg 0x1df18
libzChatUI.so: unused DT entry: type 0x6fffffff arg 0x1
W/linker: libzLoader.so: unused DT entry: type 0x6ffffffe arg 0x2ad8
libzLoader.so: unused DT entry: type 0x6fffffff arg 0x2
libzData.so: unused DT entry: type 0x6ffffffe arg 0x3f2c
W/linker: libzData.so: unused DT entry: type 0x6fffffff arg 0x3
W/OpenSSL-keystore-rsa: No valid signature returned
W/OpenSSL-keystore-rsa: No valid signature returned
W/OpenSSL-keystore-rsa: No valid signature returned
W/OpenSSL-keystore-rsa: No valid signature returned
E/BluetoothAdapter: Bluetooth binder is null
D/EGL_emulation: eglMakeCurrent: 0xb429a1c0: ver 2 0 (tinfo 0xb4235bd0)
D/EGL_emulation: eglMakeCurrent: 0xb429a1c0: ver 2 0 (tinfo 0xb4235bd0)
I usages the latest SDK, and I have following this official GitHub project shared by the Zoom team, here: This repository
For your convenience, here is the simple class I am trying:
/*
* Copyright 2021 Nurujjaman Pollob.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.methewlive.app.activities;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import com.google.android.material.textfield.TextInputEditText;
import com.methewlive.app.R;
import com.methewlive.app.Variables;
import us.zoom.sdk.JoinMeetingOptions;
import us.zoom.sdk.JoinMeetingParams;
import us.zoom.sdk.MeetingService;
import us.zoom.sdk.StartMeetingOptions;
import us.zoom.sdk.ZoomApiError;
import us.zoom.sdk.ZoomAuthenticationError;
import us.zoom.sdk.ZoomSDK;
import us.zoom.sdk.ZoomSDKAuthenticationListener;
import us.zoom.sdk.ZoomSDKInitParams;
import us.zoom.sdk.ZoomSDKInitializeListener;
public class Test extends AppCompatActivity {
private ZoomSDKAuthenticationListener authListener = new ZoomSDKAuthenticationListener() {
/**
* This callback is invoked when a result from the SDK's request to the auth server is
* received.
*/
@Override
public void onZoomSDKLoginResult(long result) {
if (result == ZoomAuthenticationError.ZOOM_AUTH_ERROR_SUCCESS) {
// Once we verify that the request was successful, we may start the meeting
startMeeting(Test.this);
}
}
@Override
public void onZoomSDKLogoutResult(long l) { }
@Override
public void onZoomIdentityExpired() { }
@Override
public void onZoomAuthIdentityExpired() { }
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
initializeSdk(this);
initViews();
}
/**
* Initialize the SDK with your credentials. This is required before accessing any of the
* SDK's meeting-related functionality.
*/
public void initializeSdk(Context context) {
ZoomSDK sdk = ZoomSDK.getInstance();
// TODO: Do not use hard-coded values for your key/secret in your app in production!
ZoomSDKInitParams params = new ZoomSDKInitParams();
params.appKey = Variables.ZOOM_API_KEY; // TODO: Retrieve your SDK key and enter it here
params.appSecret = Variables.ZOOM_API_SECRETS; // TODO: Retrieve your SDK secret and enter it here
params.domain = "zoom.us";
params.enableLog = true;
// TODO: Add functionality to this listener (e.g. logs for debugging)
ZoomSDKInitializeListener listener = new ZoomSDKInitializeListener() {
/**
* @param errorCode {@link us.zoom.sdk.ZoomError#ZOOM_ERROR_SUCCESS} if the SDK has been initialized successfully.
*/
@Override
public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) { }
@Override
public void onZoomAuthIdentityExpired() { }
};
sdk.initialize(context, listener, params);
}
private void initViews() {
findViewById(R.id.join_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
createJoinMeetingDialog();
}
});
findViewById(R.id.login_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ZoomSDK.getInstance().isLoggedIn()) {
startMeeting(Test.this);
} else {
createLoginDialog();
}
}
});
}
/**
* Join a meeting without any login/authentication with the meeting's number & password
*/
public void joinMeeting(Context context, String meetingNumber, String password) {
MeetingService meetingService = ZoomSDK.getInstance().getMeetingService();
JoinMeetingOptions options = new JoinMeetingOptions();
JoinMeetingParams params = new JoinMeetingParams();
params.displayName = "Pollob"; // TODO: Enter your name
params.meetingNo = meetingNumber;
params.password = password;
meetingService.joinMeetingWithParams(context, params, options);
}
/**
* Log into a Zoom account through the SDK using your email and password. For more information,
* see {@link ZoomSDKAuthenticationListener#onZoomSDKLoginResult} in the {@link #authListener}.
*/
public void login(String username, String password) {
int result = ZoomSDK.getInstance().loginWithZoom(username, password);
if (result == ZoomApiError.ZOOM_API_ERROR_SUCCESS) {
// Request executed, listen for result to start meeting
ZoomSDK.getInstance().addAuthenticationListener(authListener);
}
}
/**
* Start an instant meeting as a logged-in user. An instant meeting has a meeting number and
* password generated when it is created.
*/
public void startMeeting(Context context) {
ZoomSDK sdk = ZoomSDK.getInstance();
if (sdk.isLoggedIn()) {
MeetingService meetingService = sdk.getMeetingService();
StartMeetingOptions options = new StartMeetingOptions();
meetingService.startInstantMeeting(context, options);
}
}
/**
* Prompt the user to input the meeting number and password and uses the Zoom SDK to join the
* meeting.
*/
private void createJoinMeetingDialog() {
new AlertDialog.Builder(this)
.setView(R.layout.dialog_join_meeting)
.setPositiveButton("Join", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
AlertDialog dialog = (AlertDialog) dialogInterface;
TextInputEditText numberInput = dialog.findViewById(R.id.meeting_no_input);
TextInputEditText passwordInput = dialog.findViewById(R.id.password_input);
if (numberInput != null && numberInput.getText() != null && passwordInput != null && passwordInput.getText() != null) {
String meetingNumber = numberInput.getText().toString();
String password = passwordInput.getText().toString();
if (meetingNumber.trim().length() > 0 && password.trim().length() > 0) {
joinMeeting(Test.this, meetingNumber, password);
}
}
dialog.dismiss();
}
})
.show();
}
/**
* Prompts the user to input their account email and password and uses the Zoom SDK to login.
* See {@link ZoomSDKAuthenticationListener#onZoomSDKLoginResult} in the {@link #authListener} for more information.
*/
private void createLoginDialog() {
new AlertDialog.Builder(this)
.setView(R.layout.dialog_login)
.setPositiveButton("Log in", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
AlertDialog dialog = (AlertDialog) dialogInterface;
TextInputEditText emailInput = dialog.findViewById(R.id.email_input);
TextInputEditText passwordInput = dialog.findViewById(R.id.pw_input);
if (emailInput != null && emailInput.getText() != null && passwordInput != null && passwordInput.getText() != null) {
String email = emailInput.getText().toString();
String password = passwordInput.getText().toString();
if (email.trim().length() > 0 && password.trim().length() > 0) {
login(email, password);
}
}
dialog.dismiss();
}
})
.show();
}
}
Please let me know I am doing wrong!