无法在 Android Studio 的模拟器上安装 ARCore [英] Can't Install ARCore on emulator for Android Studio
问题描述
我不知道我是否可以问这个问题,但我真的不知道如何在 Android 模拟设备上使用 ARCore.根据官方指南,我应该在像素/像素 2 设备上使用 API 8.1 以运行任何使用 ARCore 的应用程序.遗憾的是,这些模拟器不支持 Play 商店,如果没有 Play 商店,我无法在设备上安装 ARCore.内置 Play 商店附带的设备图像不能运行 ARCore.我真的很困惑我应该如何以这种方式为 ARCore 测试任何东西.我需要它来为大学课程开发应用程序,我需要熟悉增强现实开发,但由于这个问题我什至无法开始.
更新时间:2020 年 9 月 15 日.
要使用此模拟器,首先您必须创建一个支持 AR 的虚拟设备.我在 macOS Catalina 10.15.6 上运行 Android Studio 4.0.
您可以按照
转到Tools
– AVD Manager
主菜单并创建您的AVD.我的窗口看起来像这样:
确保将 Camera Back 设置为 VirtualScene
.
为了获得可以工作的模拟器,您必须执行以下一些步骤:
但请记住:
Android Emulator
不支持用于深度、增强人脸或增强图像的 ARCore API.启用这些功能中的任何一个后,相机预览图像都不会正确渲染:GPU 相机纹理完全是黑色的,尽管在预览图像顶部绘制的 UI 元素仍然可以正确渲染.I don't know if I'm allowed to ask this question but I really can't figure out how to use ARCore on Android Emulated Device. According to the official guide I'm supposed to use API 8.1 on pixel/pixel 2 device in order to run any app which uses ARCore. Sadly those emulator don't come with the support for Play Store, and without Play Store I can't Instal ARCore on the device. The device images that come with built in Play Store can't run ARCore instead. I'm really confused about how am I supposed to test anything for ARCore in this way. I need it to develop an app for a University program and I need to become familiar with Augmented Reality Development but I can't even get started because of this issue.
解决方案Updated: September 15, 2020.
For using this emulator, at first, you have to create a virtual device with support of AR. I'm running Android Studio 4.0 on macOS Catalina 10.15.6.
You can follow the Android Studio instructions to Create a Virtual Device with AR support.
I created two virtual devices: the first is for
Google Pixel
and the second is forHuawei
.Go to
Tools
–AVD Manager
main menu and create you AVD. My window looks like this:Make sure that Camera Back is set to
VirtualScene
.Here are some steps you have to do in order to get a working emulator:
Set up Android Debug Bridge. I set up
adb
for Mac.Download ARCore_1.15_x86_for_emulator.apk from GitHub repository.
Run your AVD.
Type in Bash Terminal the following command (to be sure that the port is 5554):
adb devices
Result:
// emulator-5554 device
Go to the folder where
ARCore_1.15_x86_for_emulator.apk
is located. For instance:cd ~/Desktop
Type in Terminal for installing ARCore for AVD while the virtual device is running:
adb install -r ARCore_1.15_x86_for_emulator.apk
Repeat previous steps for additional AVDs you’d like to use.
Delight!
But remember:
Android Emulator
does not support ARCore APIs for Depth, Augmented Faces, or Augmented Images. When any of these features are enabled, the camera preview image does not render correctly: the GPU camera texture is entirely black, although UI elements drawn on top of the preview image still render correctly.这篇关于无法在 Android Studio 的模拟器上安装 ARCore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!