本文介绍了NullPointerException异常的DeviceManager.getHardwareProperties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用新版本更新ADT,它崩溃了。

 显示java.lang.NullPointerException
        在com.android.sdklib.devices.DeviceManager.getHardwareProperties(DeviceManager.java:552)
        在com.android.sdklib.devices.DeviceManager.hasHardwarePropHashChanged(DeviceManager.java:594)
        在com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1555)
        在com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1433)
        在com.android.sdklib.internal.avd.AvdManager<&初始化GT;(AvdManager.java:341)
        在com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:351)
        在com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:252)
        在com.android.sdklib.internal.repository.updater.UpdaterData<&初始化GT;(UpdaterData.java:120)
        在com.android.sdkuilib.internal.repository.SwtUpdaterData<&初始化GT;(SwtUpdaterData.java:61)
        在com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104)
        在com.android.sdkuilib.repository.SdkUpdaterWindow&LT;&初始化GT;(SdkUpdaterWindow.java:88)
        在com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:389)
        在com.android.sdkmanager.Main.doAction(Main.java:350)
        在com.android.sdkmanager.Main.run(Main.java:148)
        在com.android.sdkmanager.Main.main(Main.java:114)


解决方案

删除你的〜/ .android文件夹(在其他地方保存,以防万一),因为它可能与ADT的previous版本冲突。

When I updated ADT with newer version, it crashed.

java.lang.NullPointerException
        at com.android.sdklib.devices.DeviceManager.getHardwareProperties(DeviceManager.java:552)
        at com.android.sdklib.devices.DeviceManager.hasHardwarePropHashChanged(DeviceManager.java:594)
        at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1555)
        at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1433)
        at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:341)
        at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:351)
        at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:252)
        at com.android.sdklib.internal.repository.updater.UpdaterData.<init>(UpdaterData.java:120)
        at com.android.sdkuilib.internal.repository.SwtUpdaterData.<init>(SwtUpdaterData.java:61)
        at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104)
        at com.android.sdkuilib.repository.SdkUpdaterWindow.<init>(SdkUpdaterWindow.java:88)
        at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:389)
        at com.android.sdkmanager.Main.doAction(Main.java:350)
        at com.android.sdkmanager.Main.run(Main.java:148)
        at com.android.sdkmanager.Main.main(Main.java:114)
解决方案

Remove your ~/.android folder (save it somewhere else just in case), because it may be conflicting with a previous version of ADT.

这篇关于NullPointerException异常的DeviceManager.getHardwareProperties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 18:09