• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Installing Google Play via Android Studio (while rooted)

altjx

Member
Mar 5, 2010
85
4
Hi guys,

I have been going through hell and back over the last week trying to get Google Play installed on Android Studio. Of course there are images that come with Google Play pre-installed, but I cannot root those images using adb root.

Therefore, I have installed an Android image in Android Studio that supports Google APIs and have been trying to manually push OpenGApps onto the image. This has been a nightmare. I finally got it to work and now a few days later Google Play is no longer installed and the Pixel Launcher just keeps crashing.

Here's what I've tried thus far:

I ran into an installer that someone wrote in bash over here https://gist.github.com/cunneen/1c0d9717f8ce5ea76900ba32fa037047 and tried to replicate the results manually. Last week, things were fine. However, today, I have tried repeating the process since Google Play decided to uninstall itself.

Here's the error that I'm running into along the process:

Code:
[myuser@mbp.local:...x86-9.0-stock-20190618/Core]$ "${ANDROID_HOME}/emulator/bin64/e2fsck" -f "${HOME}/.android/avd/${AVD}.avd/system.img"                  8:11AM/06.27
e2fsck 1.42.13 (17-May-2015)
ext2fs_open2: Bad magic number in super-block
/Users/myuser/Library/Android/sdk/emulator/bin64/e2fsck: Superblock invalid, trying backup blocks...
/Users/myuser/Library/Android/sdk/emulator/bin64/e2fsck: Bad magic number in super-block while trying to open /Users/myuser/.android/avd/Pixel_2_API_28.avd/system.img

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
or
    e2fsck -b 32768 <device>

This seems to be the only hiccup that I've encountered now when trying to re-install Google Play onto this Android image. I have tried the previous step, which is to copy the Android system image from $ANDROID_HOME/system-images/android-28/google_apis/x86/system.img to replace the system.img in the AVD folder, but I still get this error.

Has anyone been able to successfully accomplish this, or is this not even possible? It seems that when I ask this question on StackOverflow, there's crickets... as if no one ever does this or something.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones