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

App crash #1182

Open
burhanz-bharatagri opened this issue Nov 11, 2024 · 1 comment
Open

App crash #1182

burhanz-bharatagri opened this issue Nov 11, 2024 · 1 comment
Labels

Comments

@burhanz-bharatagri
Copy link

Bug Report

Description of the Bug

I have added the YouTube player in the recycler view and added it as a LifecyclerObserver with the parent Fragment. There are few crashes recorded on the Firebase crashlytics dashboard.
Fatal Exception: java.lang.IllegalArgumentException
NetworkCallback was not registered

Environment details

Android Version: Android 10 to Android 14

Tested devices:

  • Galaxy A53 5G, Android 14
  • Galaxy A05, Android 14
  • Vivo 1820, Android 8.1.0

Youtube Player Library Version: 12.1.1

Sharing the stack trace here

Crashlytics - Stack trace

Platform: android

Version: 3.3.91.3 (300913)

Issue: 173d9a40b3313ffaf08e5d80386b939f

Session: 6730893D03DA000163F44FD69EE1448C_DNE_8_v2

Date: Sun Nov 10 2024 16:36:45 GMT+0530 (India Standard Time)

Fatal Exception: java.lang.IllegalArgumentException: NetworkCallback was not registered
at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:47)
at android.net.ConnectivityManager.unregisterNetworkCallback(ConnectivityManager.java:3416)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.utils.NetworkObserver.destroy(NetworkObserver.kt:43)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.LegacyYouTubePlayerView.release(LegacyYouTubePlayerView.kt:179)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView.release(YouTubePlayerView.kt:208)
at com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView.onStateChanged(YouTubePlayerView.kt:200)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320)
at androidx.lifecycle.LifecycleRegistry.backwardPass(LifecycleRegistry.jvm.kt:272)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.jvm.kt:289)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.jvm.kt:142)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.jvm.kt:124)
at androidx.fragment.app.Fragment.performDestroy(Fragment.java:3372)
at androidx.fragment.app.FragmentStateManager.destroy(FragmentStateManager.java:812)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:346)
at androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete(SpecialEffectsController.kt:664)
at androidx.fragment.app.SpecialEffectsController$Operation.completeSpecialEffect(SpecialEffectsController.kt:587)
at androidx.fragment.app.DefaultSpecialEffectsController$SpecialEffectsInfo.completeSpecialEffect(DefaultSpecialEffectsController.kt:774)
at androidx.fragment.app.DefaultSpecialEffectsController$startAnimations$3.onAnimationEnd$lambda$0(DefaultSpecialEffectsController.kt:273)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6759)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)

OkHttp Dispatcher:
at java.lang.Object.wait(Object.java)
at java.lang.Thread.parkFor$(Thread.java:2159)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1086)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1147)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

@burhanz-bharatagri
Copy link
Author

burhanz-bharatagri commented Nov 13, 2024

Similar to this I am facing. Let me know the solution.
#1049

XML file

<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView android:id="@+id/youtube_player_view" android:layout_width="match_parent" android:layout_height="match_parent" />

Player Initialization

val iFramePlayerOptions = IFramePlayerOptions.Builder() .controls(1) .fullscreen(1) // enable full screen button .build() binding.youtubePlayerView.enableAutomaticInitialization =false binding.youtubePlayerView.initialize( youTubePlayerListener = youTubePlayerListener, playerOptions = iFramePlayerOptions, handleNetworkEvents = true )

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

No branches or pull requests

1 participant