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

Error while updating property 'backgroundColor' of a view managed by: RCTVideo #649

Closed
annelorraineuy opened this issue Jun 8, 2017 · 9 comments

Comments

@annelorraineuy
Copy link

When setting a backgroundColor to the <Video> the app crashes.
Only on android devices on OS Nougat.

<Video source={videoUri} style={{ backgroundColor: '#ffffff' }} />

A fatal exception crash with the following error:
com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'backgroundColor' of a view managed by: RCTVideo
and
Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable

Here is the full log:

06-08 14:32:37.196 4164-4164/? E/unknown:ViewManager: Error while updating prop backgroundColor
                                                      java.lang.reflect.InvocationTargetException
                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                          at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:78)
                                                          at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
                                                          at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
                                                          at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:36)
                                                          at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:227)
                                                          at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152)
                                                          at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:781)
                                                          at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843)
                                                          at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48)
                                                          at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889)
                                                          at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
                                                          at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129)
                                                          at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107)
                                                          at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925)
                                                          at android.view.Choreographer.doCallbacks(Choreographer.java:702)
                                                          at android.view.Choreographer.doFrame(Choreographer.java:635)
                                                          at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
                                                          at android.os.Handler.handleCallback(Handler.java:751)
                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                          at android.os.Looper.loop(Looper.java:154)
                                                          at android.app.ActivityThread.main(ActivityThread.java:6682)
                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
                                                       Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
                                                          at android.view.TextureView.setBackgroundDrawable(TextureView.java:315)
                                                          at android.view.View.setBackground(View.java:19428)
                                                          at android.view.View.setBackgroundColor(View.java:19390)
                                                          at com.facebook.react.uimanager.BaseViewManager.setBackgroundColor(BaseViewManager.java:50)
                                                          at java.lang.reflect.Method.invoke(Native Method) 
                                                          at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:78) 
                                                          at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123) 
                                                          at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42) 
                                                          at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:36) 
                                                          at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:227) 
                                                          at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152) 
                                                          at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:781) 
                                                          at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843) 
                                                          at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48) 
                                                          at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889) 
                                                          at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31) 
                                                          at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129) 
                                                          at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107) 
                                                          at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925) 
                                                          at android.view.Choreographer.doCallbacks(Choreographer.java:702) 
                                                          at android.view.Choreographer.doFrame(Choreographer.java:635) 
                                                          at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) 
                                                          at android.os.Handler.handleCallback(Handler.java:751) 
                                                          at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                          at android.os.Looper.loop(Looper.java:154) 
                                                          at android.app.ActivityThread.main(ActivityThread.java:6682) 
                                                          at java.lang.reflect.Method.invoke(Native Method) 
                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) 
                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) 
06-08 14:32:37.196 4164-4164/? D/AndroidRuntime: Shutting down VM
06-08 14:32:37.197 4164-4164/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.rooplaymedia.rooplay, PID: 4164
                                                 com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'backgroundColor' of a view managed by: RCTVideo
                                                     at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:90)
                                                     at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
                                                     at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
                                                     at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:36)
                                                     at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:227)
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152)
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:781)
                                                     at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843)
                                                     at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48)
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889)
                                                     at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
                                                     at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129)
                                                     at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107)
                                                     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925)
                                                     at android.view.Choreographer.doCallbacks(Choreographer.java:702)
                                                     at android.view.Choreographer.doFrame(Choreographer.java:635)
                                                     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
                                                     at android.os.Handler.handleCallback(Handler.java:751)
                                                     at android.os.Handler.dispatchMessage(Handler.java:95)
                                                     at android.os.Looper.loop(Looper.java:154)
                                                     at android.app.ActivityThread.main(ActivityThread.java:6682)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
                                                  Caused by: java.lang.reflect.InvocationTargetException
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:78)
                                                     at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123) 
                                                     at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42) 
                                                     at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:36) 
                                                     at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:227) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:781) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889) 
                                                     at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31) 
                                                     at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129) 
                                                     at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107) 
                                                     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925) 
                                                     at android.view.Choreographer.doCallbacks(Choreographer.java:702) 
                                                     at android.view.Choreographer.doFrame(Choreographer.java:635) 
                                                     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) 
                                                     at android.os.Handler.handleCallback(Handler.java:751) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                     at android.os.Looper.loop(Looper.java:154) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:6682) 
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) 
                                                  Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
                                                     at android.view.TextureView.setBackgroundDrawable(TextureView.java:315)
                                                     at android.view.View.setBackground(View.java:19428)
                                                     at android.view.View.setBackgroundColor(View.java:19390)
                                                     at com.facebook.react.uimanager.BaseViewManager.setBackgroundColor(BaseViewManager.java:50)
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:78) 
                                                     at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123) 
                                                     at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42) 
                                                     at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:36) 
                                                     at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:227) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:781) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48) 
                                                     at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889) 
                                                     at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31) 
                                                     at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129) 
                                                     at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107) 
                                                     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925) 
                                                     at android.view.Choreographer.doCallbacks(Choreographer.java:702) 
                                                     at android.view.Choreographer.doFrame(Choreographer.java:635) 
                                                     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) 
                                                     at android.os.Handler.handleCallback(Handler.java:751) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                     at android.os.Looper.loop(Looper.java:154) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:6682) 
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) 
06-08 14:32:37.198 3664-19058/? D/Debug: !@DumpState : SHIP
06-08 14:32:37.198 3664-19058/? D/Debug: !@DumpState : debug level:0x4f4c
06-08 14:32:37.198 3664-19058/? D/Debug: !@Dumpstate : Finally, system will skip dumpstate

@pawlowskim
Copy link

Same here, setting backgroundColor to black for android crashes the app.

@zztiswb116
Copy link

zztiswb116 commented Jul 12, 2017

Is this problem solved?I also met the same problem

@dittmarconsulting
Copy link

Exact the same error as @annelorraineuy

@kelset
Copy link

kelset commented Aug 7, 2017

Same error here. Is there any workaround atm? Is not setting backgroundColor enough?

cornedor referenced this issue in TheWidlarzGroup/react-native-video-player Aug 11, 2017
@Sundin
Copy link

Sundin commented Aug 17, 2017

+1

@brianfoody
Copy link

Just removing the backgroundColor style is enough to fix this issue.If you need just wrap it in View with the backgroundColor applied there.

<View style={{backgroundColor: 'pink'}}>
    <Video ...

@magnudae
Copy link

magnudae commented May 7, 2018

Still think it should be a fix for this. The workaround does not work for iOS.
Now one actually needs to check what kind of device one is on to reliably set the background. Which becomes an issue if one wants to remove the black background from iOS.

@dogbutcat
Copy link

The error detail is 「TextureView doesn't support displaying a background drawable」and I find the question on stackoverflow . I solved it when setting the targetSdkVersion to 23.

@AlexandruVoica
Copy link

AlexandruVoica commented Sep 27, 2018

For those wondering about @dogbutcat 's response, he means go to android/app/build.gradle and modify the targetSdkVersion and compileSdkVersion.

android {
  compileSdkVersion 23
  buildToolsVersion “23.0.1”

  defaultConfig {
    applicationId “com.example.checkyourtargetsdk"
    minSdkVersion 7
    targetSdkVersion 23
    versionCode 1
    versionName “1.0”
  }
}

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

No branches or pull requests