- First get the YouTube APK from here: http://www.apkmirror.com/apk/google-inc/youtube/
- I chose the latest release, then picked the 480dpi version for x86. You might want x86_64 depending on how you setup your Android Virtual Device.
- You need to use the "adb" command line tool which comes with the Android SDK. To find it, using Android Studio click "File->Settings."
- Go to "Appearance & Behavior->System Settings->Android SDK"
- Near the top is the "Android SDK Location", e.g. "C:\Users\
\AppData\Local\Android\Sdk" - Now you can use the Terminal tab in Android Studio and change to the "platform-tools" folder within the SDK directory, e.g.
"cd C:\Users\\AppData\Local\Android\sdk\platform-tools" - Also copy the YouTube APK to that folder to make the command easier to run.
- Then you can run: "adb install youtube.apk"
FWIW I also added some code to my YouTubeActivity.java to make it a little nicer on the user having a problem:
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
youTubeInitializationResult.getErrorDialog(YouTubeActivity.this, 0).show();
}
Although since the Google Play Store isn't installed on the emulator the error dialog isn't as useful as it could be, since it directs you to install the app via a button click, but it at least tells you why the app isn't working.
I also had a fatal exception after that, without any really useful error, but I hadn't added the INTERNET permission to my app so it all worked after that.
1 comment:
I downloaded a ps2 ISO and copied into the Play! emulator as soon as I run the game I can only see is black screen and a controller..
more info
Post a Comment