Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE on stopping the recorder #33

Closed
sagrawal31 opened this issue Mar 12, 2020 · 7 comments
Closed

NPE on stopping the recorder #33

sagrawal31 opened this issue Mar 12, 2020 · 7 comments

Comments

@sagrawal31
Copy link

This exception is being thrown very frequently but can be reproduced. This is being thrown when stopped manually or when the timer finishes or when manually stopped (using the checkmark button):

03-12 15:03:17.593 11542 11542 E AndroidRuntime: FATAL EXCEPTION: main
03-12 15:03:17.593 11542 11542 E AndroidRuntime: Process: in.org.hooman, PID: 11542
03-12 15:03:17.593 11542 11542 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at androidx.core.content.ContextCompat.checkSelfPermission(ContextCompat.java:544)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.BaseActionFragment.isPermissionGranted(BaseActionFragment.java:101)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.BaseActionFragment.isPermissionsGranted(BaseActionFragment.java:45)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.BaseRecorderFragment.startRecording(BaseRecorderFragment.java:99)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.BaseCameraRecorderFragment.startRecording(BaseCameraRecorderFragment.java:116)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.CameraRecorderFragment.startRecording(CameraRecorderFragment.java:356)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.BaseRecorderFragment.lambda$loadConfigs$0(BaseRecorderFragment.java:52)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.ui.fragments.-$$Lambda$BaseRecorderFragment$VhRSI25HqTq6r_2bTkvqb6hQSx4.countdown(Unknown Source:2)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.recorder.CountDownHandler.start(CountDownHandler.java:24)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.recorder.CountDownHandler.lambda$start$0(CountDownHandler.java:29)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.ziggeo.androidsdk.recorder.-$$Lambda$CountDownHandler$gOW88V4_LPzxBPjp_4xr40KxRdE.run(Unknown Source:6)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:883)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:100)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:237)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7811)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-12 15:03:17.593 11542 11542 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)

Options I'm using are:

const options: ZiggeoOption = {
    facing: 1,
    maxDuration: this.competency.timePerQuestion,     // being set to 2 minutes
    autoRecord: true,
    disableCameraSwitch: true,
    confirmStopRecording: true,
    countdown: 3,
    title: this.question.title,
    quality: 1,     // 1 == medium quality
    customData: {
        questionID: 'some value',
        userID: 'some value',
        assessmentTestID: 'some value'
    }
};
@sagrawal31
Copy link
Author

@3akat this was not crashing when we were using 0.82.2 version.

@sagrawal31
Copy link
Author

To help you out, you can reproduce the issue with these options:

HashMap<String, String> extras = new HashMap<>();
extras.put("data", "{ \"foo\": \"bar\" }");
extras.put("title", "Tell me about a situation in which you had to solve a very difficult problem?");

ziggeo = new Ziggeo(APP_TOKEN, CameraFullscreenRecorderActivity.this);
RecorderConfig config = new RecorderConfig.Builder()
        .callback(prepareCallback())
        .sendImmediately(true)
        .startDelay(3)
        .enableCoverShot(false)
        .autostartRecording(true)
        .disableCameraSwitch(true)
        .maxDuration(50000)
        .extraArgs(extras)
        .quality(CameraView.QUALITY_MEDIUM)
        .confirmStopRecording(true)
        .facing(CameraView.FACING_FRONT)
        .build();

ziggeo.setRecorderConfig(config);
ziggeo.startCameraRecorder();

@3akat
Copy link
Contributor

3akat commented Mar 12, 2020

Hi @sagrawal31,
Thanks for reporting. Today I'm busy with other tasks, will deal with this one tomorrow the first thing.

@sagrawal31
Copy link
Author

Thank you, @3akat

Since yesterday, we were happy that today we'll finally be able to roll out our app to production track on Google Play but after upgrading SDK to 0.82.5 when we tested, this issue showed up. And we are stuck again.

Requesting to pick this issue as soon as you can. Thanks again!

@sagrawal31
Copy link
Author

By the way, I figured out the option (by commenting out the options one by one) which is causing this crash.

It's because .autostartRecording(true). When I'm removing this line, that crash is gone.

@3akat
Copy link
Contributor

3akat commented Mar 12, 2020

Please take a look at 0.82.6

@sagrawal31
Copy link
Author

😮 I can't believe that you went extra mile to resolve this issue even you were busy. And the biggest thing is that it fixes the issue.

Thanks a lot @3akat

Hats off to the Ziggeo team! 👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants