My app crash when i do FlutterYoutube.playYoutubeVideoById on Android device, but it works fine on IOS device.
the log shows something like:
D/AndroidRuntime( 4571): Shutting down VM
E/AndroidRuntime( 4571): FATAL EXCEPTION: main
E/AndroidRuntime( 4571): Process: com.example.youtube, PID: 4571
E/AndroidRuntime( 4571): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.youtube/io.github.ponnamkarthik.flutteryoutube.PlayerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference
E/AndroidRuntime( 4571): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
E/AndroidRuntime( 4571): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
E/AndroidRuntime( 4571): at android.app.ActivityThread.-wrap12(ActivityThread.java)
E/AndroidRuntime( 4571): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
E/AndroidRuntime( 4571): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4571): at android.os.Looper.loop(Looper.java:154)
E/AndroidRuntime( 4571): at android.app.ActivityThread.main(ActivityThread.java:6119)
E/AndroidRuntime( 4571): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4571): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
E/AndroidRuntime( 4571): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
E/AndroidRuntime( 4571): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference
E/AndroidRuntime( 4571): at io.github.ponnamkarthik.flutteryoutube.PlayerActivity.onCreate(PlayerActivity.java:33)
E/AndroidRuntime( 4571): at android.app.Activity.performCreate(Activity.java:6679)
E/AndroidRuntime( 4571): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
E/AndroidRuntime( 4571): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
E/AndroidRuntime( 4571): ... 9 more
My app crash when i do
FlutterYoutube.playYoutubeVideoById
on Android device, but it works fine on IOS device.the log shows something like: