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

问题描述 投票:3回答:3

在设置模拟器上使用干净的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。这可能是什么问题?

android android-emulator android-wifi
3个回答
3
投票

我自己设法解决了这个问题。问题似乎是由于com.android.settings.wfd.WifiDisplaySettings.isAvailable报告WiFi可用,而wifip2p服务缺席。我去了WifiDisplaySettings.java:216并用false取代了这张支票,所以它不会试图找到这项服务。现在可以正确打开设置。


3
投票

改变你的WifiDisplaySettings.java in

/you tao SP root/packages/apps/settings/双人床/com/Android/settings/瓦房店/WiFi display settings.Java

更改代码段

public static boolean isAvailable(Context context) {
        return context.getSystemService(Context.DISPLAY_SERVICE) != null
                && context.getSystemService(Context.WIFI_P2P_SERVICE) != null;
}

public static boolean isAvailable(Context context) {
    return false;
}

然后

make systemimage 

1
投票

也许这也有帮助。我注意到在使用lunch aosp_x86-userdebug而不是lunch aosp_x86-eng构建干净的Android 8时,Settings应用程序没有崩溃。

© www.soinside.com 2019 - 2024. All rights reserved.