Call for testing: Android Studio

Thanks, published the new build to candidate, this is what we should release.

One thing I noticed is that a single commit to git actually results in two new revisions of the same snap in dashboard.snapcraft.io, in this case revision 29 and 30 were published. I was on revision 28 previously, first I released rev29 to candidate and did a snap refresh android-studio which completed quickly (delta update worked), then I released rev30 to candidate channel and again did a refresh but this time its re-downloading the complete snap.

That’s some odd bug in the infrastructure that I don’t really understand.

By default build will build an amd64, i386 and armhf snap. The armhf builders are down for maintenance, so you’re getting an amd64 and i386 build. One revision will be the 64-bit build, the other will be the i386 build. We currently don’t have a way to force build.snapcraft.io to only build one arch, but I believe that’s on the roadmap.

That’s odd behavior ? If I am on 64bit arch then why is my system pulling both 64bit and 32bit revision.

Interestingly, this snap says it supports both amd64 and i386 architectures. Probably because it contains some amd64 and some i386 binaries.

As suspected, this is broken. It works on amd64 perfectly, but if you install it on an i386 system, it’s broken.

I suspect we may need the architectures: [amd64] stanza ? Or some other way to make it not build a mixed snap. Not quite sure how we do that with build.snapcraft.io - perhaps @cjwatson know the magic?

I’ve never seen a snap which has the same revision in both architectures before.

 # snapcraft status android-studio
Track    Arch    Channel    Version    Revision
latest   amd64   stable     -          -
                 candidate  3.0.1.0    27
                 beta       3.0.1.0    27
                 edge       3.0.1.0    27
         i386    stable     -          -
                 candidate  3.0.1.0    27
                 beta       3.0.1.0    27
                 edge       3.0.1.0    27

(or does it just need to ship with both amd64 and i386 jre? That seems a nasty solution).

The architectures stuff is planned but not yet implemented in Launchpad, and in any case it will probably only serve to limit the set of builds that are dispatched. Launchpad isn’t going to be doing anything to explicitly build a multi-architecture snap - it must be something in your package’s build system.

(I don’t believe that revision 27 was built on Launchpad; it seems to have been built manually.)

The build was done by build.snapcraft.io

Android Studio comes with JRE and the tarball they provide is supposed to work on both amd64 and i386 unchanged.

I will download a i386 image now and run Android Studio directly from the source they provide (I believe that will definitely work).

Well … it may have been built by BSI but it wasn’t uploaded to the store by BSI/Launchpad.

print(sorted(build.store_upload_revision for build in lp.load('~build.snapcraft.io/+snap/125825f60ca4a81dbf25024d40e45f87-xenial').completed_builds if build.store_upload_revision))
[16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 29, 30]

So I just tried Ubuntu 16.04 i386 in a VM and I get the exact same error from non-snap install as well. So It seems Google only cares about 64bit users so only ships 64bit JRE with source.

Shall we only support Android Studio on 64bit machines for now ?

The updated snap only builds for 64bit installs, so the above issue won’t happen.

I have installed android studio from snap on different distro over the past few month and so far so good. Lets move this to stable now (revision 34 that is).

1 Like

Done! Thanks!

yesterday version 3.1 has come out
Can you update it?

https://www.phoronix.com/scan.php?page=news_item&px=Android-Studio-3.1-Released

1 Like

I have version 3.1.0.16 (35) on Ubuntu 17.10, amd64 but I can’t launch any AVD. Whichever device configuration I choose, any attempt to start the emulator just gives:

11:03 AM Executing tasks: [:app:assembleDebug]

11:03 AM Emulator: libGL error: unable to load driver: i965_dri.so

11:03 AM Emulator: libGL error: driver pointer missing

11:03 AM Emulator: libGL error: failed to load driver: i965

11:03 AM Emulator: libGL error: unable to load driver: swrast_dri.so

11:03 AM Emulator: libGL error: failed to load driver: swrast

11:03 AM Emulator: X Error of failed request: BadValue (integer parameter out of range for operation)

11:03 AM Emulator: Major opcode of failed request: 152 (GLX)

11:03 AM Emulator: Minor opcode of failed request: 24 (X_GLXCreateNewContext)

11:03 AM Emulator: Value in failed request: 0x0

11:03 AM Emulator: Serial number of failed request: 56

11:03 AM Emulator: Current serial number in output stream: 57

11:03 AM Emulator: Process finished with exit code 1

1 Like

Seems similar to this topic?

I don’t know. Android Studio uses classic confinement so it shouldn’t have any OpenGL restrictions?

1 Like

No, not really. Its a known issue with Android Studio and linux, please try to export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 in your environment and that should fix it.

Try in a terminal

ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 android-studio

If that fixes it, you need to add that variable to a more permanent place.

More reading here: https://developer.android.com/studio/command-line/variables.html

1 Like

Yes, this does the trick. Thank you so much for the solution.
IMO the snap package should be updated to include this in its launch script.

1 Like

Today I installed this on my fresh 18.04 install and I got from zero to having an app in the review queue on Google Play in under 5 hours. Everything just worked. The only problem was the emulator crash described above, but I could just test on real hardware. Excellent stuff. I’m also enjoying the intellij and pycharm snaps. :slight_smile:

5 Likes

Where is ANDROID_HOME for the snap?

1 Like