When updating Chrome on Android Studio's Emulator, Chrome crashes - android

I am using Android Studio's device manager to run an emulated android tablet device on my Mac (M1). Specifically, the device targets API 30 and uses the arm64 architecture. By default, this device comes with the Chrome browser, version 91.
My goal is to update Chrome to the latest version possible (as of this post, version 108). Unfortunately, what I've tried either doesn't actually update Chrome or results in Chrome crashing immediately upon start up.
1. Clicking Chrome's Update Button - does nothing
The Chrome browser prompts me to update it, but clicking on this does nothing. The menu just closes.
2. Updating Chrome from the Play Store - can't select my device
I tried going through the Play Store instead. However, when I do this, it prompts me to select a valid device via a dropdown menu, and the emulator is not selectable in this dropdown.
3. Installing the APK via Android Debug Bridge - Chrome crashes
Finally, various places suggest using adb to install a Chrome APK file. This gist summarizes the process (remove old chrome, download the desired APK, and install it via command line).
I believe I'm supposed to download the "arm64-v8a + armeabi-v7a" version, because the architecture must match and my device manager is telling me my architecture is arm64:
When I install via adb, I get the "Success" message, and I can see in the app info on the emulator that Chrome is now version 108. However, when I attempt to turn it on, it crashes immediately.
For what it's worth, I tried every available APK architecture in the list just in case arm64 was wrong, and they all result in the same thing: "Success", but crashing upon startup.
Is it possible to update Chrome on an android emulator? Is there something I may be missing when installing the APK?
Let me know if more info is needed!

So, posting this question was apparently enough info for Stack Overflow to give me a good "Related Questions" list, and I found an answer on Is Google Play Store supported in avd emulators?.
Essentially, only some images support the Google Play Store; I hadn't realized this. That was why my attempts 1 and 2 (update via Chrome or Play Store respectively) didn't work. Once I used an image that supported the Play Store, I was able to update Chrome just fine!
Inconveniently, none of the tablet images support the play store, but there's a workaround.
Getting a Tablet Emulator with Google Play Store
Select an image that supports the Play Store (indicated by the icon in the Play Store column). I was only able to find these in the Phone section.
Download one of the provided system images. We only care that this image is downloaded, and we don't actually need to create this device.
Go back to the Device Manager and find your tablet image. Use its dropdown menu to Wipe Data and then Show on Disk. You may duplicate the image first, but wiping the data is important for the emulator to start on a clean slate.
Clicking Show on Disk should have brought up the files for that image. Locate config.ini and open it.
Change PlayStore.enabled from false to true.
Change image.sysdir.1, replacing where it says google_apis with google_apis_playstore instead. We downloaded this image on Step 2.
Save and start up the emulator. You now have a tablet emulator with the play store enabled!

Related

Android Studio AVD Emulator Chrome and Play Store missing

I am making my first developer steps on Android.
Trying my first test app on an Android Virtual Device (AVD), I noticed that the device has almost no software on it, there is no Play Store and no Chrome Browser. See Screenshot. I checked all settings up and down but found no way to tweak the basic OS software load. I tried several phone models and API levels, but had no luck.
How can I create a device providing software support similar to a physical device, I do specifically need an Internet browser.
Google Play System Images
When creating the emulator, you need to select and create a system image that contains the playstore.

Android Oreo 8.0 Emulator With Google Play Store

I have the latest official emulator image of Android Oreo with Google Play. While creating (emulator) device, the sd-card, internal memory are non-editable. When the emulator starts, it notifies to use sd-card as internal/external storage but none of the options works and fails at formatting step.
It's not recognized by "adb" or in AndroidStudio. Cannot debug even after enabling from developer options.
It's play store is not getting updated, only shows downloading by Download Manager, nothing happens after that notification is gone.
The emulators with and without google play have different Google Settings> Security Screen-
Without Google Play(Left) -- With Google Play(Right)
My questions-
Is it possible to use it for debugging? If yes, How?
Why different Google Security setting in the two emulators with/without GP at Android o? Is it Google Play update issue or something else?
How to update the Google Play in emulator when its storage size cannot be increased (if it's the memory issue)?
I believe that this problem is not related to Oreo image but other components of the system recently updated because older emulator images with Google Play have the same problem suddenly. Every image with Google Play have this problem.
Anyway I fixed it with clearing environment variables like ANDROID_SDK_HOME or ANDROID_HOME.
I think the bug occurs when user files are not under user home folder (C:\users\ or ~username).
I had moved user files to my D: partition due to low disk space and this problem occured.
To solve the problem I set following env. vars:
ANDROID_SDK_ROOT = D:\Android\sdk
ANDROID_AVD_HOME = D:\Android\avd
This way SDK and AVD files are under D:\Android and other user files including adbkey* are under user home folder.
Please have a look at https://developer.android.com/studio/command-line/variables.html#android_sdk_root to tailor your needs.

Unable to download device for Xamarin Android Player , Getting Operation Time out Error

I am not able to download any device from device list of XAP.
Do not have any logs at ProgramData or \Program Files\Xamarin Android Player. I am behind a corporate proxy. Do I need to configure proxy some where ?
I also tried from home, and it times out after downloading around 40 MB!!
My (rather obvious) guess is that the proxy is interfering somehow. You can access the logs as so:
Right click the bottom bar of the Device Manager (the window you have screen shot)
Click on 'Generate Bug Report'
Check your Desktop for the resulting zip file containing the logs.
Xamarin Android Player is Preview software and any issues are best reported in a bug report.
It may also be wise to check out the Visual Studio Android Emulator or the official Google AVD for which the x86 images with HAXM support offer far better performance than their earlier counterparts. You can download the images through the Android SDK Manager or set up the devices via Android Studio if you have it installed.

GoogleMaps, "This app wont run unless you update Google Play services." On emulator [duplicate]

When integrating a Google Plus login button in an Android app, I'm observing some differences in how the button appears on an actual device and in the emulator. I am aware of the fact that the Google Plus services APKs are not installed in the emulator, but this can be worked around by pulling the APKs from a device and installing them into the emulator using APK.
My current "implementation" simply includes the login button in a layout, by referring to the button with the following XML code:
<com.google.android.gms.common.SignInButton
android:id="#+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
When I test my app on the device, the button appears all red and shiny, according to the guidelines mentioned here https://developers.google.com/+/mobile/android/sign-in . But when running on the emulator, it's just a normal button (grey background with black text) saying "Sign in with Google".
Any idea why the results are different? I've made sure I'm running the same API level, and the resource does seem to get pulled in correctly also on the emulator since it shows the actual login button (but with a different look).
Update: Found a clue in logcat; the message "Sign in button not found, using placeholder instead." pretty much explains why I'm seeing the grey dull button on the emulator. Still need to figure out why; could be the "copy google plus apk's from device" hack isn't working properly.
Google Play services works on the 4.2.2 versions of the Android Emulator and is officially supported as described in the Android documentation: Setup Google Play Services.
Update
You now can use the Intel/x86 images (HAXM-compatible) for API 19 and newer and for ARM, Google Play Services is available on most images.
Setting up the image
To get the right image for your virtual device manager:
Open the Android SDK Manager
Open the group Android 4.2.2 (API 17)
Check Google APIs
Check ARM EABI v7a System Image
To create the Virtual Device:
Open the Android Virtual Device Manager
Create a New device
Enter an AVD name
Set the target to Google APIs (Google Inc.) - API Level 17
Save your Virtual device and start it...
Note CPU/ABI will be fixed as ARM
Now you should be able to use the Google Play Services in the emulator. Of note, you need to set your target appropriately in your Android project to the Google APIs in order for Google Play Services to work.
I tried most combinations of running the emulator, but with and without the Google APIs, which means I tested with both x86 and arm modes. I found no way of making the apk's pulled from my Galaxy Nexus phone to run correctly on the emulator.
Guessing this is somewhat related to getting the Play Store up and running, I decided to try that as well to see if I had more luck. I did not; could not get that working either. The Play Store icons appear and can be launched, but it immediately closes itself.
What did work however was to download and install the apks at the bottom of the page here:
http://umut.tekguc.info/en/content/google-android-map-v2-step-step
After installing the vending and gms packages, the login button appeared in it's full beauty under the emulator. Since I haven't actually implemented the actual login functionality yet, I can not be sure that it will actually work, but at least the button now looks identical in my app on my device and in the emulator.
You also need to download the Google Play Services software (look under "Extras" in the Android SDK manager), and install the library google-play-services_lib in your project (File-Import-Android-Existing Android Code Into Workspace, and then browse to for instance /opt/adt-bundle-linux/sdk/extras/google/google_play_services/libproject and select google-play-services_lib).
Another interesting tidbit is that this will only work on the "pure" Android emulator setups, not with the "Google API" setups. It seems the latter have some parts of those apps installed in the emulator already (not visibly and not working), and I haven't managed to remove the existing versions to install the custom apk files that worked as described above. I tested adb remove, adb install, adb install -r, and even removing the directories from /data which also failed. It's looking very much like Google is trying to make this difficult.
I'm disappointed Google is making this so hard; Google may have some weird licensing reasons for keeping this stuff out of the emulator, but if they really want people to use their services in their Android apps they need to make these services available in the emulator. Forcing people to always develop on a device (with otherwise excellent emulators available) or making people jump through hoops (lots of googling, installing unofficial/hacked versions of the apks etc) is just evil.
Final update before accepting my answer; although the correct button with the correct styling is now showing in the emulator, I am still not able to get the "pick account" dialog to appear in the emulator. When/if I do I will share the proper solution here.
Check the ldpi, mdpi, hdpi, etc... folders for a different button graphic. Your emulator is almost certainly a different DPI than your device.
i have noticed that from API 21 there are ARM and x86 images with Google APIs implemented
perhaps if you have no problem emulating using android 5 it will works without extracting the APKs

Signed App cant install on low end tablet

Hi guys, I know most of people faced the problem same like me.
But I still cant solve this problems.
I had build android app and this app is using Google Map API and Google Places API.
I had signed my apk file using Eclipse wizard, but when I transfer it to my tab (taiwan product) using SD Card it said "application not installed". I never installed this app with debug key before. All others Google Map apps I downloaded from Play store can use well in this tab.
I set min android version is 2.2 and highest is 4.0.3. My tab running on 4.0.3.
I also tried to install this app to other brands low end tablet, and it was successful.
But in my tablet, it failed.
Anybody have idea why I can't install this signed apk file? I had tried so much to solve this.
thanks..
There comes a time in every Android user's life where you want to install an app not found in the Android Market. If it's your first time, you're greeted with, "For security, your phone is set to block installation of applications not obtained from the Android Market" message as you try to install. But how do we get there?
To allow app installs from non-Market apps, tap the menu button on your home screen, then choose Settings >> Applications >> Unknown sources.
Who are these "Unknown sources," and what do they want? Simply put, it's anything other than the Android Market. Could be an app sent by e-mail. Or downloaded from a website.
If you're worried about the security implications of allowing unknown sources, there's an easy fix -- install the app from outside the Android Market, and then hit the checkbox again to turn them back off.
source.

Categories

Resources