React-native无法为类找到生成的setter

时间:2017-03-23 16:23:52

标签: android react-native

我正在尝试实现ViewGroupManager来创建我自己的原生视图。 对于我的一个任务,我需要一个指向我的视图实例的链接。为了接收它我使用@ReactProperty注释,但看起来它不起作用(即使不是我的组件)。我在日志中找到了许多行“无法找到生成的类的setter ...”

03-23 15:10:43.104 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
03-23 15:10:43.104 3144-3174/com.reactapp.test I/dalvikvm: Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
03-23 15:10:43.104 3144-3174/com.reactapp.test W/dalvikvm: VFY: unable to resolve static method 41824: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
03-23 15:10:43.104 3144-3174/com.reactapp.test D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
03-23 15:10:43.112 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
03-23 15:10:43.112 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
03-23 15:10:43.112 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
03-23 15:10:43.116 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
03-23 15:10:43.116 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
03-23 15:10:43.128 3144-3144/com.reactapp.test W/EGL_genymotion: eglSurfaceAttrib not implemented
03-23 15:10:43.128 3144-3147/com.reactapp.test D/dalvikvm: GC_CONCURRENT freed 284K, 4% free 11148K/11527K, paused 10ms+0ms, total 12ms
03-23 15:10:43.128 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
03-23 15:10:43.136 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
03-23 15:10:43.136 3144-3144/com.reactapp.test D/OpenGLRenderer: Enabling debug mode 0
03-23 15:10:43.156 3144-3144/com.reactapp.test D/OpenGLRenderer: TextureCache::get: create texture(0xb7a788e8): name, size, mSize = 1, 4096, 4096
03-23 15:10:43.156 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
03-23 15:10:43.156 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
03-23 15:10:43.156 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
03-23 15:10:43.160 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
03-23 15:10:43.160 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
03-23 15:10:43.160 3144-3147/com.reactapp.test D/dalvikvm: GC_CONCURRENT freed 489K, 5% free 11199K/11719K, paused 11ms+1ms, total 16ms
03-23 15:10:43.160 3144-3175/com.reactapp.test D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 3ms
03-23 15:10:43.164 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
03-23 15:10:43.168 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
03-23 15:10:43.172 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
03-23 15:10:43.172 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
03-23 15:10:43.172 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
03-23 15:10:43.172 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
03-23 15:10:43.188 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
03-23 15:10:43.192 3144-3147/com.reactapp.test D/dalvikvm: GC_CONCURRENT freed 408K, 5% free 11264K/11783K, paused 11ms+2ms, total 20ms
03-23 15:10:43.224 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
03-23 15:10:43.224 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
03-23 15:10:43.232 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
03-23 15:10:43.232 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
03-23 15:10:43.232 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
03-23 15:10:43.232 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
03-23 15:10:43.232 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
03-23 15:10:43.236 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
03-23 15:10:43.252 3144-3147/com.reactapp.test D/dalvikvm: GC_CONCURRENT freed 367K, 4% free 11321K/11783K, paused 10ms+0ms, total 14ms
03-23 15:10:43.256 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
03-23 15:10:43.256 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
03-23 15:10:43.256 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
03-23 15:10:43.264 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
03-23 15:10:43.280 3144-3147/com.reactapp.test D/dalvikvm: GC_CONCURRENT freed 405K, 5% free 11347K/11847K, paused 10ms+1ms, total 16ms
03-23 15:10:43.284 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
03-23 15:10:43.284 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
03-23 15:10:43.284 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
03-23 15:10:43.292 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
03-23 15:10:43.292 3144-3175/com.reactapp.test W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.reactlibrary.MyNativeViewModule

技术细节:

  • 反应:15.4.2
  • React-native:0.42.3
  • React-native-cli:2.0.1

ReactProp注释的导入是:

import com.facebook.react.uimanager.annotations.ReactProp;

1 个答案:

答案 0 :(得分:1)

我通过设置@ReactProp(name =“ ...”)正确为自己的组件修复了该问题。

我在这里犯了一个错误,它与javascript中声明的不匹配。所以警告的意思是:我错过了我可以设置的道具之一!

检查您的JavaScript代码,并确保那里的每个道具都具有匹配的@ReactProp

因此对于6692错误,我怀疑同一件事还在发生...