cordova-plugin-streaming-media icon indicating copy to clipboard operation
cordova-plugin-streaming-media copied to clipboard

A lot of NullPointerExceptions

Open RhuanGonzaga opened this issue 6 years ago • 6 comments

What version of Streaming-Meda-Cordova-Plugin are you using? Latest 2.1.3

What version of Cordova are you using? Cordova 8.0.0

What devices are affected? A lot of android devices in different api versions

image

Please describe the issue in detail, with relevant code samples

I'm loogin on my play store developer account dashboard and I can see a lot of errors becoming from this plugin:

image

This error appears for about 10% of users, here is line section:

	public void onActivityResult(int requestCode, int resultCode, Intent intent) {
		Log.v(TAG, "onActivityResult: " + requestCode + " " + resultCode);
		super.onActivityResult(requestCode, resultCode, intent);
		if (ACTIVITY_CODE_PLAY_MEDIA == requestCode) {
			if (Activity.RESULT_OK == resultCode) {
				this.callbackContext.success(); // LINE 98
			} else if (Activity.RESULT_CANCELED == resultCode) {
				String errMsg = "Error";
				if (intent != null && intent.hasExtra("message")) {
					errMsg = intent.getStringExtra("message");
				}
				this.callbackContext.error(errMsg);
			}
		}
	}

RhuanGonzaga avatar Sep 17 '18 13:09 RhuanGonzaga

can you post the entire trace? it's cutoff at the top

shamilovtim avatar Sep 17 '18 13:09 shamilovtim

Hi, thanks for reply.

java.lang.RuntimeException: 
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4050) 
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4115) 
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3286)
  at android.app.ActivityThread.access$1000 (ActivityThread.java:218) 
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1744) 
  at android.os.Handler.dispatchMessage (Handler.java:102) 
  at android.os.Looper.loop (Looper.java:145) 
  at android.app.ActivityThread.main (ActivityThread.java:7007) 
  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:1404)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException:
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4775)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4036)
Caused by: java.lang.NullPointerException:
  at com.hutchind.cordova.plugins.streamingmedia.StreamingMedia.onActivityResult (StreamingMedia.java:98)
  at org.apache.cordova.CordovaInterfaceImpl.onActivityResult (CordovaInterfaceImpl.java:159)
  at org.apache.cordova.CordovaActivity.onActivityResult (CordovaActivity.java:359)
  at android.app.Activity.dispatchActivityResult (Activity.java:6867)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4771)

RhuanGonzaga avatar Sep 17 '18 14:09 RhuanGonzaga

Thanks for sharing, I think I can take care of this. Do you know whether the apps are crashing or exiting ?

shamilovtim avatar Sep 17 '18 14:09 shamilovtim

Hi, thank for helping and about your question, I dont know.

RhuanGonzaga avatar Sep 17 '18 15:09 RhuanGonzaga

@shamilovtim @RhuanGonzaga Any update on this issue. I am also facing the same thing. Thank you.

2xSamurai avatar Apr 01 '19 11:04 2xSamurai

@2xSamurai Sorry! Could you explain what the impact of this issue is on your application? thank you!

shamilovtim avatar Apr 03 '19 17:04 shamilovtim