scientiffic
scientiffic

Reputation: 9415

Android: NoClassDefFoundError with YouTubePlayerFragment on Gingerbread

I'm using the Youtube API to play Youtube videos in my Android app. It works fine on newer phones, but when I try to run on a device running Gingerbread, I get the error:

Unable to resolve superclass of Lcom/google/android/youtube/player/YouTubePlayerFragment; (21)
Link of class 'Lcom/google/android/youtube/player/YouTubePlayerFragment;' failed
VFY: unable to resolve static method 9606: Lcom/google/android/youtube/player/YouTubePlayerFragment;.newInstance ()Lcom/google/android/youtube/player/YouTubePlayerFragment;
thread exiting with uncaught exception (group=0x40015578)
FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.android.youtube.player.YouTubePlayerFragment

I've read many other SO questions regarding the NoClassDefFoundError, but I can't seem to resolve this issue. These are the things I've done:

Does anyone know how to solve this problem?

Upvotes: 1

Views: 525

Answers (2)

Prateek Yadav
Prateek Yadav

Reputation: 942

please use the older API 1.0 I also have the same issue with 1.2.

Upvotes: 0

CzarMatt
CzarMatt

Reputation: 1833

I don't believe fragments are supported pre-honeycomb (without appropriate compatibility libraries that is).

Try using com.google.android.youtube.player.YouTubePlayerSupportFragment instead.

See here for more information: https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayerSupportFragment

Upvotes: 1

Related Questions