当我尝试从模拟器中的设置菜单打开存储时,它(总是)崩溃并出现以下 logcat 输出
java.lang.NullPointerException at com.android.settings.deviceinfo.StorageVolumePreferenceCategory.updatePreferencesFromState(StorageVolumePreferenceCategory.java:238)
以下是我的 AVD 的详细信息:
Name: Mx
Path: /home/vvy/.android/avd/Mx.avd
Target: Android 4.2.2 (API level 17)
ABI: armeabi-v7a
Skin: 480x800
Sdcard: /home/vvy/Documents/ANDU/sdC.img
________________________________________
hw.dpad: no
avd.ini.encoding: ISO-8859-1
disk.dataPartition.size: 200M
hw.gpu.enabled: yes
hw.cpu.model: cortex-a8
hw.ramSize: 512
hw.sdCard: yes
hw.device.name: Nexus One
vm.heapSize: 32
请注意,我能够从 Eclipse DDMS 角度将数据上传到 SDCard,并且股票 GALLERY 应用程序能够显示通过 DDMS 角度推送的图像内容。
这是一个已知的问题 ?还是我做错了什么?
- - - - - - - - -更新 - - - - - - -
相关的 logcat 输出
05-31 09:11:42.280: D/StorageMeasurement(2117): getDirectorySize(/mnt/sdcard/Alarms) returned 1536
05-31 09:11:42.340: D/StorageMeasurement(2117): getDirectorySize(/mnt/sdcard/Music) returned 1536
05-31 09:11:42.400: I/ActivityManager(287): Displayed com.android.settings/.SubSettings: +2s386ms
05-31 09:11:42.560: D/AndroidRuntime(2117): Shutting down VM
05-31 09:11:42.560: W/dalvikvm(2117): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
05-31 09:11:42.611: D/StorageMeasurement(2117): getDirectorySize(/mnt/sdcard/Notifications) returned 1536
05-31 09:11:42.671: E/AndroidRuntime(2117): FATAL EXCEPTION: main
05-31 09:11:42.671: E/AndroidRuntime(2117): java.lang.NullPointerException
05-31 09:11:42.671: E/AndroidRuntime(2117): at com.android.settings.deviceinfo.StorageVolumePreferenceCategory.updatePreferencesFromState(StorageVolumePreferenceCategory.java:238)
05-31 09:11:42.671: E/AndroidRuntime(2117): at com.android.settings.deviceinfo.StorageVolumePreferenceCategory.updateApproximate(StorageVolumePreferenceCategory.java:307)
05-31 09:11:42.671: E/AndroidRuntime(2117): at com.android.settings.deviceinfo.StorageVolumePreferenceCategory$1.handleMessage(StorageVolumePreferenceCategory.java:91)
05-31 09:11:42.671: E/AndroidRuntime(2117): at android.os.Handler.dispatchMessage(Handler.java:99)
05-31 09:11:42.671: E/AndroidRuntime(2117): at android.os.Looper.loop(Looper.java:137)
05-31 09:11:42.671: E/AndroidRuntime(2117): at android.app.ActivityThread.main(ActivityThread.java:5041)
05-31 09:11:42.671: E/AndroidRuntime(2117): at java.lang.reflect.Method.invokeNative(Native Method)
05-31 09:11:42.671: E/AndroidRuntime(2117): at java.lang.reflect.Method.invoke(Method.java:511)
05-31 09:11:42.671: E/AndroidRuntime(2117): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-31 09:11:42.671: E/AndroidRuntime(2117): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-31 09:11:42.671: E/AndroidRuntime(2117): at dalvik.system.NativeStart.main(Native Method)
05-31 09:11:42.761: W/ActivityManager(287): Force finishing activity com.android.settings/.SubSettings
05-31 09:11:42.801: D/StorageMeasurement(2117): getDirectorySize(/mnt/sdcard/Pictures) returned 1536
05-31 09:11:42.801: D/StorageMeasurement(2117): getDirectorySize(/mnt/sdcard/Download) returned 1536
05-31 09:11:42.841: D/StorageMeasurement(2117): getDirectorySize(/mnt/sdcard) returned 14941696
05-31 09:11:42.921: W/ActivityManager(287): Force finishing activity com.android.settings/.Settings
更新
有人可以告诉我他们是否让股票存储应用程序在(模拟器)android 4.2.2 中工作
存储应用程序在 android 2.3.7 图像(在模拟器上)上运行良好!而且我还没有找到解决方案
更新
也不适用于 x86 图像。我在 LinuxMint13 和 Win7 上都试过了。