Android模拟器重启失败

时间:2019-07-05 18:47:42

标签: android-emulator hyper-v hypervisor ms-android-emulator

我使用Visual Studio 2019安装了Android模拟器,并使用Windows功能启用了hyper-v和hypervisor平台。

我使用“ Android设备管理器”工具创建了新设备,当我启动它时,它运行良好。但是,如果我关闭它并重新开始,它将打开,并且屏幕显示上次会话的最后状态。然后什么也没有发生,它永远不会加载。如果我将设备系统设置恢复为默认状态并重新启动,则可以正常运行,但是我不想每次都这样做,而且我希望能够在会话之间存储应用程序数据。

那我该如何工作呢?

还是我如何使其停止尝试保存状态,始终开始冷态?

我有Windows 10,Android仿真器版本28.0.25,SDK工具26.1.1,SDK平台工具28.0.2。

我的设备的config.ini:

disk.dataPartition.size=800M
hw.accelerometer=yes
hw.audioInput=yes
hw.battery=yes
hw.camera.back=emulated
hw.dPad=no
hw.gps=yes
hw.gpu.mode=auto
hw.keyboard=yes
hw.lcd.density=320
hw.lcd.height=720
hw.lcd.width=1280
hw.mainKeys=yes
hw.ramSize=1024
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
sdcard.size=100M
skin.dynamic=yes
skin.name=1280x720
vm.heapSize=256
hw.device.hash2=MD5:e6de262aae26d1ce2c8a8b656265afbc
hw.device.name=4.7in WXGA
hw.device.manufacturer=Generic
showDeviceFrame=no
tag.id=google_apis
tag.display=Google APIs
PlayStore.enabled=false
abi.type=x86
hw.cpu.arch=x86
hw.gpu.enabled=yes
avd.ini.displayname=720x1280_A9.0
image.sysdir.1=system-images\android-28\google_apis\x86\
AvdId=720x1280_a9_0

Android设备监控器工具中的某些日志:

E/SurfaceFlinger(1732): ro.sf.lcd_density must be defined as a build property
E/LocalDisplayAdapter(6626): Default and active color mode is no longer available! Reverting to first available mode.
E/LightsService(6626): Unable to get ILight interface.
E/Parcel(6626): Class not found when unmarshalling: android.content.pm.PackageParser$SigningDetail?
E/Parcel(6626): java.lang.ClassNotFoundException: android.content.pm.PackageParser$SigningDetail?
E/Parcel(6626):     at java.lang.Class.classForName(Native Method)
E/Parcel(6626):     at java.lang.Class.forName(Class.java:453)
E/Parcel(6626):     at android.os.Parcel.readParcelableCreator(Parcel.java:2803)
E/Parcel(6626):     at android.os.Parcel.readParcelable(Parcel.java:2757)
E/Parcel(6626):     at android.content.pm.PackageParser$Package.<init>(PackageParser.java:6821)
E/Parcel(6626):     at android.content.pm.PackageParser.fromCacheEntryStatic(PackageParser.java:1071)
E/Parcel(6626):     at android.content.pm.PackageParser.fromCacheEntry(PackageParser.java:1058)
E/Parcel(6626):     at android.content.pm.PackageParser.getCachedResult(PackageParser.java:1152)
E/Parcel(6626):     at android.content.pm.PackageParser.parsePackage(PackageParser.java:1013)
E/Parcel(6626):     at com.android.server.pm.ParallelPackageParser.parsePackage(ParallelPackageParser.java:138)
E/Parcel(6626):     at com.android.server.pm.ParallelPackageParser.lambda$submit$0(ParallelPackageParser.java:117)
E/Parcel(6626):     at com.android.server.pm.-$$Lambda$ParallelPackageParser$FTtinPrp068lVeI7K6bC1tNE3iM.run(Unknown Source:6)
E/Parcel(6626):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
E/Parcel(6626):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Parcel(6626):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Parcel(6626):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/Parcel(6626):     at com.android.internal.util.ConcurrentUtils$1$1.run(ConcurrentUtils.java:62)
E/Parcel(6626): Caused by: java.lang.ClassNotFoundException: android.content.pm.PackageParser$SigningDetail?
E/Parcel(6626):     at java.lang.Class.classForName(Native Method)
E/Parcel(6626):     at java.lang.BootClassLoader.findClass(ClassLoader.java:1346)
E/Parcel(6626):     at java.lang.BootClassLoader.loadClass(ClassLoader.java:1406)
E/Parcel(6626):     at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/Parcel(6626):     ... 17 more
E/Parcel(6626): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
E/Parcel(6626): Class not found when unmarshalling: android.content.pm.PackageParser$Signing???????
E/Parcel(6626): java.lang.ClassNotFoundException: android.content.pm.PackageParser$Signing???????
E/Parcel(6626):     at java.lang.Class.classForName(Native Method)
E/Parcel(6626):     at java.lang.Class.forName(Class.java:453)
E/Parcel(6626):     at android.os.Parcel.readParcelableCreator(Parcel.java:2803)
E/Parcel(6626):     at android.os.Parcel.readParcelable(Parcel.java:2757)
E/Parcel(6626):     at android.content.pm.PackageParser$Package.<init>(PackageParser.java:6821)
E/Parcel(6626):     at android.content.pm.PackageParser.fromCacheEntryStatic(PackageParser.java:1071)
E/Parcel(6626):     at android.content.pm.PackageParser.fromCacheEnpm.PackaageParser.java:1058)
E/Parcel(6626):     at android.content.pm.PackageParser.getCachedResult(PackageParser.java:1152)
E/Parcel(6626):     at android.content.pm.PackageParser.parsePackage(PackageParser.java:1013)
E/Parcel(6626):     at com.android.server.pm.ParallelPackageParser.parsePackage(ParallelPackageParser.java:138)
E/Parcel(6626):     at com.android.server.pm.ParallelPackageParser.lambda$submit$0(ParallelPackageParser.java:117)
E/Parcel(6626):     at com.android.server.pm.-$$Lambda$ParallelPackageParser$FTtinPrp068lVeI7K6bC1tNE3iM.run(Unknown Source:6)
E/Parcel(6626):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
E/Parcel(6626):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Parcel(6626):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Parcel(6626):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/Parcel(6626):     at com.android.internal.util.ConcurrentUtils$1$1.run(ConcurrentUtils.java:62)
E/Parcel(6626): Caused by: java.lang.ClassNotFoundException: android.content.pm.PackageParser$Signing???????
E/Parcel(6626):     at java.lang.Class.classForName(Native Method)
E/Parcel(6626):     at java.lang.BootClassLoader.findClass(ClassLoader.java:1346)
E/Parcel(6626):     at java.lang.BootClassLoader.loadClass(ClassLoader.java:1406)
E/Parcel(6626):     at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/Parcel(6626):     ... 17 more
E/Parcel(6626): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
E/PackageManager(6626): Adding duplicate user id: 10008 name=com.google.android.gms

那只是文件路径和前缀为

的非语言代码
  

A / system_server(6626):file_utils.cc:113]

1 个答案:

答案 0 :(得分:0)

有一个名为Quickboot的设置,您可以为每个AVD分别禁用它,它将每次都进行冷启动。

但这不是最好的解决方案,我希望Quickboot能够实际工作。

enter image description here

参考https://developer.android.com/studio/run/emulator.html#quickboot