Android 8 设置应用程序在具有干净 AOSP 构建的模拟器上崩溃

标签 android android-emulator android-wifi

“设置”应用程序在模拟器上使用干净的 Android 8 构建 (aosp_x86-eng) 打开后会立即崩溃。 logcat 输出如下:

--------- beginning of main
1536  1550 E memtrack: Couldn't load memtrack module
1536  1550 W android.os.Debug: failed to get memory consumption info: -1
--------- beginning of system
1536  1548 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings (has extras)} from uid 10013
1373  2321 W audio_hw_generic: Not supplying enough data to HAL, expected position 926726 , only wrote 926722
2477  2477 W zygote  : Unexpected CPU variant for X86 using defaults: x86
1536  1548 I ActivityManager: Start proc 2477:com.android.settings/1000 for activity com.android.settings/.Settings
2477  2477 I zygote  : The ClassLoaderContext is a special shared library.
2477  2477 D OpenGLRenderer: HWUI GL Pipeline
2477  2477 W TileUtils: Found com.android.settings.backup.BackupSettingsActivity for intent Intent { act=com.android.settings.action.SETTINGS pkg=com.android.settings } missing metadata com.android.settings.category
2477  2477 D ConditionManager: conditions loading asychronously
2477  2496 D ConditionManager: loading conditions from xml
2477  2495 E BluetoothAdapter: Bluetooth binder is null
2477  2495 V NFC     : this device does not have NFC support
1388  1836 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2477  2500 D SuggestionParser: Day 0 for com.android.settings.suggested.category.FIRST_IMPRESSION
2477  2495 D BatteryInfo: time to make batteryStatsHelper: 1ms
1536  1554 I WifiService: requestActivityInfo uid=1000
1536  1554 I WifiService: reportActivityInfo uid=1000
1536  1554 I WifiService: getSupportedFeatures uid=1000
1536  1606 W HalDeviceManager: isWifiStarted called but mWifi is null!?
2477  2500 I SuggestionParser: Use fingerprint requires unavailable feature android.hardware.fingerprint
1536  1554 E BluetoothAdapter: Bluetooth binder is null
1536  1554 E BatteryExternalStatsWorker: no controller energy info supplied for wifi
1536  1554 E KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
1536  1554 E BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
2477  2500 I SuggestionParser: Add another fingerprint requires unavailable feature android.hardware.fingerprint
2477  2495 D BatteryInfo: time for getStats: 10ms
2477  2500 W TileUtils: Found com.android.settings.backup.BackupSettingsActivity for intent Intent { act=com.android.settings.action.SETTINGS pkg=com.android.settings } missing metadata com.android.settings.category
1643  1852 D EGL_emulation: eglMakeCurrent: 0x945dab60: ver 2 0 (tinfo 0x945e4970)
1380  1380 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 1540096
1380  1525 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 1540096
2477  2499 D         : HostConnection::get() New Host Connection established 0xa750eb00, tid 2499
2477  2499 I zygote  : android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2477  2499 I OpenGLRenderer: Initialized EGL, version 1.4
2477  2499 D OpenGLRenderer: Swap behavior 1
2477  2500 E SystemServiceRegistry: No service published for: wifip2p
2477  2500 E SystemServiceRegistry: android.os.ServiceManager$ServiceNotFoundException: No service published for: wifip2p
2477  2500 E SystemServiceRegistry:     at android.os.ServiceManager.getServiceOrThrow(ServiceManager.java:75)
2477  2500 E SystemServiceRegistry:     at android.app.SystemServiceRegistry$49.createService(SystemServiceRegistry.java:569)
2477  2500 E SystemServiceRegistry:     at android.app.SystemServiceRegistry$49.createService(SystemServiceRegistry.java:567)
2477  2500 E SystemServiceRegistry:     at android.app.SystemServiceRegistry$StaticServiceFetcher.getService(SystemServiceRegistry.java:987)
2477  2500 E SystemServiceRegistry:     at android.app.SystemServiceRegistry.getSystemService(SystemServiceRegistry.java:914)
2477  2500 E SystemServiceRegistry:     at android.app.ContextImpl.getSystemService(ContextImpl.java:1667)
2477  2500 E SystemServiceRegistry:     at android.view.ContextThemeWrapper.getSystemService(ContextThemeWrapper.java:171)
2477  2500 E SystemServiceRegistry:     at android.app.Activity.getSystemService(Activity.java:5915)
2477  2500 E SystemServiceRegistry:     at com.android.settings.wfd.WifiDisplaySettings.isAvailable(WifiDisplaySettings.java:216)
2477  2500 E SystemServiceRegistry:     at com.android.settings.SettingsActivity.doUpdateTilesList(SettingsActivity.java:845)
2477  2500 E SystemServiceRegistry:     at com.android.settings.SettingsActivity.-wrap0(Unknown Source:0)
2477  2500 E SystemServiceRegistry:     at com.android.settings.SettingsActivity$5.run(SettingsActivity.java:747)
2477  2500 E SystemServiceRegistry:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
2477  2500 E SystemServiceRegistry:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
2477  2500 E SystemServiceRegistry:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
2477  2500 E SystemServiceRegistry:     at java.lang.Thread.run(Thread.java:764)
1536  1548 W ActivityManager:   Force finishing activity com.android.settings/.Settings
1536  1552 I ActivityManager: Showing crash dialog for package com.android.settings u0

似乎崩溃与 WiFi 有某种关系,但 Android 模拟器无论如何都不应该支持 WiFi。这可能是什么问题?

最佳答案

我设法自己修复了它。问题似乎是由于 com.android.settings.wfd.WifiDisplaySettings.isAvailable 报告 WiFi 可用,而 wifip2p 服务不存在。我转到 WifiDisplaySettings.java:216 并将此检查替换为 false,因此它不会尝试定位服务。现在可以正常打开设置了。

关于Android 8 设置应用程序在具有干净 AOSP 构建的模拟器上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47839955/

相关文章:

java - 本地化不显示在设备上

android - ICS 仿真器没有软件按钮?

android - 无法从扫描结果连接 SSID - Android

android - 如何通过ADB连接wifi

Android 链接到无线和网络设置

java - 如何解决 : Error:Execution failed for task ':app:kaptDebugKotlin' ?

java - 添加自定义控件作为标记 OSMDROID BONUS PACK

java - 我如何追踪哪个图像是我的应用程序的 killer ?

android - 无法在 Android Studio 2.0 Preview b3 上启动模拟器

ios - 我正在尝试在 Windows PC 中使用 IOS Simulator/Emulator 或 iOS SDK a.Is it possible to install IOS Simulator/Emulator or iOS SDK in windows PC