Search code examples
javaandroidandroid-youtube-api

OpenYoutubeActivity: java.lang.NoClassDefFoundError OpenYouTubePlayerActivity


I am trying to implement Youtube player to my Android app but I have a problem of run it normally. I have next exception:

java.lang.NoClassDefFoundError: OpenYouTubePlayerActivity

Try to find something in Google, saw a lot of similar solutions which are the same as mine but it isn't working. How can I fix it?

This is my piece of code: (openyoutubeactivity.jar and its path has add to my project, different permissions have added and everything was did by official doc of this lib)

Intent lVideoIntent = new Intent(null, Uri.parse("ytv://jDgDW8bSdvw"), this, OpenYouTubePlayerActivity.class);
    startActivity(lVideoIntent);

Solution

  • I have managed to fix it, there was just need to add a signature to the link in the VideoStream file of this library and everything is working like charm!

    VideoStream.java (Line: 30)
    before: mUrl = lArgMap.get("url");
    after:  mUrl = lArgMap.get("url") + "&signature=" + lArgMap.get("sig");