React-native-youtube: Incompatible with React Native >=0.7.1: More than one plugin attempted to publish the same registration name, `onError`

Created on 4 Aug 2015  路  9Comments  路  Source: davidohayon669/react-native-youtube

The application won't start due to the error, as in title:
screen shot 2015-08-03 at 17 43 58

This is because react native RCTImageViewManager already publishes an event onError, for discussion see: https://github.com/facebook/react-native/issues/1952

I have a solution to this in my fork, will test it works and submit a PR to fix.

Most helpful comment

I am still getting this issue with the onError function for Android. I'm on a recent version of ReactNative. Anyone else getting this issue, or know what could cause it?

By the way, does npm install work or does it need to be git cloned?

All 9 comments

Submitted PR https://github.com/paramaggarwal/react-native-youtube/pull/7 to fix this issue.

Based on empirical testing, merging that, and https://github.com/paramaggarwal/react-native-youtube/pull/5, make this component compatible at least up to React Native 0.9.

Thanks a lot @jevakallio! Merged both PRs. Published to npm as v0.1.3.

I am still getting this issue with the onError function for Android. I'm on a recent version of ReactNative. Anyone else getting this issue, or know what could cause it?

By the way, does npm install work or does it need to be git cloned?

@KabirKang I'm not using this module in my app, it's even not listed in package.json / node_modules, however I got this issue as well after updating to rn 0.39. So just googled this issue here :)

However one of my own modules had this method and disabling the module helped me to build the app

Maybe it's related to this change:
https://github.com/facebook/react-native/commit/e87e181998bf4f8efba2c7e04bec0929344600b9

I'm also seeing this after upgrading to RN 0.39. Not sure it's related to react-native-youtube though. Have not been able to pinpoint the actual problem yet.

@undef1ned what exactly did you change in your app? Could you post the changes you made in your app to fix this. Maybe this will help the rest of us on how to solve it in our apps. Thanks!!

EDIT: Oops I meant to refer to @undef1ned :D

@IjzerenHein Simply check your other node_modules/* whether some of them exposes onError method. I did the same changes to my custom module, as it's here https://github.com/inProgress-team/react-native-youtube/issues/7 and the issue disappeared. I think it is related to Image.onError which is defined by RN now, so other modules can not expose this method anymore

EDIT: You can either set a breakpoint at the line where it fails and check the arguments, but the object passed is a little bit messy. Or simply do a full-text search

EDIT2: Current issue was caused by the same problem, Image.onError was added for iOS in 0.8.0-rc

@undef1ned Thanks for the feedback!

Finally found that it is indeed the onError event in react-native-youtube that is the culprit (in my app). I don't quite know how to properly fix it, but after renaming the following instance of "onError" the error is gone and the app starts. Hope this helps anyone else in actually fixing the problem properly..

// YouTubeManager.java
@Override
    public
    @Nullable
    Map getExportedCustomDirectEventTypeConstants() {
        return MapBuilder.of(
                "error",
                MapBuilder.of("registrationName", "onError2"), // <-- renamed from onError to onError2
                "ready",
                MapBuilder.of("registrationName", "onReady"),

@IjzerenHein Yeah, it's also present in the Youtube.android.js so you should replace it everywhere to make it work and may-be submit pull-request :)

FYI, I submitted a PR for this #90 to fix the issue on RN 0.39

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dblazeski picture dblazeski  路  5Comments

matthiasleitner picture matthiasleitner  路  5Comments

savioseb picture savioseb  路  4Comments

nhcuong95 picture nhcuong95  路  5Comments

webdevbyjoss picture webdevbyjoss  路  4Comments