question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working on Android

See original GitHub issue

I’ve implemented successfully in ios but it not working in android. I’ve added API key but don’t know it correct or not because it accepted any value So I can’t sure it not working because wrong API key or my code. Can someone provide full tutorial on this implementation ? <YouTube apiKey="AIzaSyCZs5LGQYP8EL8uQvvpO6SA-cFZs8kHw30" ref="youtubePlayer" videoId="tAawfiPaTbY" play={false} hidden={false} fullscreen={true} loop={false} style={{alignSelf: 'stretch', height: 300, backgroundColor: 'black', marginVertical: 10}} /> </View>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
victor-axelssoncommented, Jul 19, 2017

I had the same issue. I logged onError and got a Warning: Native component for "ReactYouTube" does not exist error.

I did run the react-native link but it seems like it didn’t fix all issues for me.

Im my MainApplication I needed to add the ReactNativeYouTube to the react packages list. I use the following versions (from my package.json):

    "react": "16.0.0-alpha.12",
    "react-native": "0.46.1",
    "react-native-youtube": "^1.0.0-beta.1",

And my MainApplication now looks like this:

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new ReactNativeYouTube(), /// <- here I added the package, which wasn't added before.
          new MainReactPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}
5reactions
martinchristovcommented, Sep 6, 2017

@victor-axelsson your solution works! But you forgot to mention you need to include at the top of MainApplication.java:

import com.inprogress.reactnativeyoutube.ReactNativeYouTube;

Thanks ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an installed Android app that isn't working - Google Support
Step 1: Restart & update · Open the Google Play Store app Google Play . · At the top right, tap the profile...
Read more >
are my apps not working on my Android phone - Carlcare
How to fix android apps not working · Reboot your phone · Update or roll back Android System WebView app · Check and...
Read more >
15 common Android problems and how to fix them - CNET
There may be two causes for your apps not downloading. First, go back to the last page on this list and try clearing...
Read more >
Phone app not working on Android? Here're 12 ways to fix it
1. Close the App and Reopen it · 2. Force Stop the Phone App · 3. Restart your Android Phone · 4. Clear...
Read more >
Android OS problems and how to fix them How To
Wait for the battery to drain until it gets below that number again. If the phone works as expected with no early shutdown,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found