I am using the current module for react-native-youtube but for android. It works fine until I navigate from the component that plays the youtube video and then go back to it. I get the following:

Can I get any help regarding this issue?
It happened for me time to time when LiveReload is on.
Do you have the same issue when you're not in debug ?
I have the same problem here
can't we just try to use a webview like ios for android?
I had this issue on both debug and release. I couldn't resolve the problem, however I noticed I would only get this error when i changed from the view hosting the video to another view and then back again to the original view. It makes me wonder if this issue has something to do with the fact that I am re-inflating the youtube view again?
When i press R+R then i got this same error after causing error which is similar to issue https://github.com/inProgress-team/react-native-youtube/issues/69 - only at first time shows up
android.view.InflateException: Binary XML file line #9: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.view.View.inflate(View.java:18532)
at com.inprogress.reactnativeyoutube.YouTubeView.init(YouTubeView.java:31)
at com.inprogress.reactnativeyoutube.YouTubeView.<init>(YouTubeView.java:26)
at com.inprogress.reactnativeyoutube.YouTubeManager.createViewInstance(YouTubeManager.java:44)
at com.inprogress.reactnativeyoutube.YouTubeManager.createViewInstance(YouTubeManager.java:15)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:44)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:211)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:776)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)
at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:44)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:868)
at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:765)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.IllegalArgumentException: Binary XML file line #9: Duplicate id 0x7f0d0070, tag null, or parent id 0x7f0d006f with another fragment for com.google.android.youtube.player.YouTubePlayerFragment
at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2120)
at android.app.Activity.onCreateView(Activity.java:5328)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)聽
at android.view.View.inflate(View.java:18532)聽
at com.inprogress.reactnativeyoutube.YouTubeView.init(YouTubeView.java:31)聽
at com.inprogress.reactnativeyoutube.YouTubeView.<init>(YouTubeView.java:26)聽
at com.inprogress.reactnativeyoutube.YouTubeManager.createViewInstance(YouTubeManager.java:44)聽
at com.inprogress.reactnativeyoutube.YouTubeManager.createViewInstance(YouTubeManager.java:15)聽
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:44)聽
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:211)聽
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)聽
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:776)聽
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)聽
at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:44)聽
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:868)聽
at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)聽
at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)聽
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:765)聽
at android.view.Choreographer.doCallbacks(Choreographer.java:580)聽
at android.view.Choreographer.doFrame(Choreographer.java:549)聽
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)聽
at android.os.Handler.handleCallback(Handler.java:739)聽
at android.os.Handler.dispatchMessage(Handler.java:95)聽
at android.os.Looper.loop(Looper.java:135)聽
at android.app.ActivityThread.main(ActivityThread.java:5254)聽
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:903)聽
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)聽
Here full stacktrace.
Perhaps this might be of help:
http://stackoverflow.com/a/19815266/1125823
Note: You cannot inflate a layout into a fragment when that layout includes a
. Nested fragments are only supported when added to a fragment dynamically.
Namely, that we should be constructing the player dynamically instead of using the fragment. The above stackoverflow answer has an example of this. Perhaps the example given in the YouTubeAndroidPlayerApi-1.0.0.zip is incorrect in this regard?
I'm having the same problem, though it is when I load the component with the YT video that the exception occurs. It happens with any combination of Live Reload, Hot Reload and Remote Debugging.
@julien-inprogress is anyone working on this at the moment? I have some time I could spend trying to fix.
Is anyone able to find any solution about this issue
@manjeet-dobble I tried for a couple of days but I couldn't find a workable solution. Someone with more native experience needs to take over.
I have created a issue #86 , have mentioned few of my thoughts and willing to work but don't have idea from where to start
Actually after little bit of searching I am able to play YouTube videos within listview using webview see SO post, but I am unable to get fullscreen button right now, any help will be appereciated
@ronnpang1 @morelazers I found out why this was happening for me. It is when on android you have more than one
@jeremypagley Still happening for me on Android. I'm only using one
The same for me, using one simple component with one
Wanted to display a video in the cards of the react-native-tinder-swipe-cards package. Getting the same error on Android, really annoying.
I guess still no one found a solution yet?
+1
This problem is solvable with version 1 and up.
The native YouTube instance in android is a singleton and need to be unmounted when leaving a navigation scene and getting back.
More explanations in the v1 README
Most helpful comment
@julien-inprogress is anyone working on this at the moment? I have some time I could spend trying to fix.