i am using this widget. This widget is must required to my app. But when i run the app first time i got error. when i run second time video played successfully. Please any one can help me.
I am using titanium sdk 6.3.0
Error:
TiApplication: (main) [21233,99172] No valid root or current activity found for application instance
[ERROR] : TiVideoView8: (main) [4,99176] Error setting video data source: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference
[ERROR] : TiVideoView8: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference
[ERROR] : TiVideoView8: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:990)
[ERROR] : TiVideoView8: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:957)
[ERROR] : TiVideoView8: at android.widget.TiVideoView8.setDataSource(TiVideoView8.java:347)
[ERROR] : TiVideoView8: at android.widget.TiVideoView8.openVideo(TiVideoView8.java:393)
[ERROR] : TiVideoView8: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:310)
[ERROR] : TiVideoView8: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:299)
[ERROR] : TiVideoView8: at ti.modules.titanium.media.TiUIVideoView.propertyChanged(TiUIVideoView.java:157)
[ERROR] : TiVideoView8: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
[ERROR] : TiVideoView8: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1096)
[ERROR] : TiVideoView8: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
[ERROR] : TiVideoView8: at ti.modules.titanium.media.VideoPlayerProxy.handleMessage(VideoPlayerProxy.java:423)
[ERROR] : TiVideoView8: at android.os.Handler.dispatchMessage(Handler.java:98)
[ERROR] : TiVideoView8: at android.os.Looper.loop(Looper.java:135)
[ERROR] : TiVideoView8: at android.app.ActivityThread.main(ActivityThread.java:5343)
[ERROR] : TiVideoView8: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiVideoView8: at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] : TiVideoView8: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
[ERROR] : TiVideoView8: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
[ERROR] : MediaPlayer: prepareAsync called in state 1
[DEBUG] : AndroidRuntime: Shutting down VM
[ERROR] : TiApplication: (main) [3,99179] Sending event: exception on thread: main msg:java.lang.IllegalStateException; Titanium 6.3.0,2017/10/31 18:13,undefined
[ERROR] : TiApplication: java.lang.IllegalStateException
[ERROR] : TiApplication: at android.media.MediaPlayer.prepareAsync(Native Method)
[ERROR] : TiApplication: at android.widget.TiVideoView8.openVideo(TiVideoView8.java:398)
[ERROR] : TiApplication: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:310)
[ERROR] : TiApplication: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:299)
[ERROR] : TiApplication: at ti.modules.titanium.media.TiUIVideoView.propertyChanged(TiUIVideoView.java:157)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1096)
[ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
[ERROR] : TiApplication: at ti.modules.titanium.media.VideoPlayerProxy.handleMessage(VideoPlayerProxy.java:423)
[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98)
[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:135)
[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5343)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
i am using this widget. This widget is must required to my app. But when i run the app first time i got error. when i run second time video played successfully. Please any one can help me.
I am using titanium sdk 6.3.0
Error: TiApplication: (main) [21233,99172] No valid root or current activity found for application instance [ERROR] : TiVideoView8: (main) [4,99176] Error setting video data source: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference [ERROR] : TiVideoView8: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference [ERROR] : TiVideoView8: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:990) [ERROR] : TiVideoView8: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:957) [ERROR] : TiVideoView8: at android.widget.TiVideoView8.setDataSource(TiVideoView8.java:347) [ERROR] : TiVideoView8: at android.widget.TiVideoView8.openVideo(TiVideoView8.java:393) [ERROR] : TiVideoView8: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:310) [ERROR] : TiVideoView8: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:299) [ERROR] : TiVideoView8: at ti.modules.titanium.media.TiUIVideoView.propertyChanged(TiUIVideoView.java:157) [ERROR] : TiVideoView8: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) [ERROR] : TiVideoView8: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1096) [ERROR] : TiVideoView8: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363) [ERROR] : TiVideoView8: at ti.modules.titanium.media.VideoPlayerProxy.handleMessage(VideoPlayerProxy.java:423) [ERROR] : TiVideoView8: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiVideoView8: at android.os.Looper.loop(Looper.java:135) [ERROR] : TiVideoView8: at android.app.ActivityThread.main(ActivityThread.java:5343) [ERROR] : TiVideoView8: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiVideoView8: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : TiVideoView8: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) [ERROR] : TiVideoView8: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) [ERROR] : MediaPlayer: prepareAsync called in state 1 [DEBUG] : AndroidRuntime: Shutting down VM [ERROR] : TiApplication: (main) [3,99179] Sending event: exception on thread: main msg:java.lang.IllegalStateException; Titanium 6.3.0,2017/10/31 18:13,undefined [ERROR] : TiApplication: java.lang.IllegalStateException [ERROR] : TiApplication: at android.media.MediaPlayer.prepareAsync(Native Method) [ERROR] : TiApplication: at android.widget.TiVideoView8.openVideo(TiVideoView8.java:398) [ERROR] : TiApplication: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:310) [ERROR] : TiApplication: at android.widget.TiVideoView8.setVideoURI(TiVideoView8.java:299) [ERROR] : TiApplication: at ti.modules.titanium.media.TiUIVideoView.propertyChanged(TiUIVideoView.java:157) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1096) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363) [ERROR] : TiApplication: at ti.modules.titanium.media.VideoPlayerProxy.handleMessage(VideoPlayerProxy.java:423) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:135) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5343) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)