求解答:Android的一个小的应用程序在模拟器中的运行问题

Android的一个小的应用程序在手机上运行时一点儿问题都没有,在Android 2.3.3模拟器中也无问题,可是在4.0 以上的模拟器中运行时会异常退出。在网上搜了一大圈儿,可都是模拟器中运行正常而真机上运行不正常的问题。在开源社区中有tfc写了相关的问题,但他只说“已找到了问题的答案,是因为android4.03 模拟器的问题,在设备上可以正常运行的”,可具体情况是怎样,哪位高手忙我解答解答,感激不尽啊!

在4.0.3中运行日志如下:
08-29 16:24:50.213: E/AudioEffect(646): set(): AudioFlinger could not create effect, status: -22
08-29 16:24:50.213: E/visualizers-JNI(646): Visualizer initCheck failed -4
08-29 16:24:50.213: E/Visualizer-JAVA(646): Error code -4 when initializing Visualizer.
08-29 16:24:50.223: W/dalvikvm(646): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
08-29 16:24:50.233: E/AndroidRuntime(646): FATAL EXCEPTION: main
08-29 16:24:50.233: E/AndroidRuntime(646): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wjq.audiofx/com.wjq.audiofx.Main}: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -4
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.os.Looper.loop(Looper.java:137)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.ActivityThread.main(ActivityThread.java:4424)
08-29 16:24:50.233: E/AndroidRuntime(646):     at java.lang.reflect.Method.invokeNative(Native Method)
08-29 16:24:50.233: E/AndroidRuntime(646):     at java.lang.reflect.Method.invoke(Method.java:511)
08-29 16:24:50.233: E/AndroidRuntime(646):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-29 16:24:50.233: E/AndroidRuntime(646):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-29 16:24:50.233: E/AndroidRuntime(646):     at dalvik.system.NativeStart.main(Native Method)
08-29 16:24:50.233: E/AndroidRuntime(646): Caused by: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -4
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.media.audiofx.Visualizer.<init>(Visualizer.java:182)
08-29 16:24:50.233: E/AndroidRuntime(646):     at com.wjq.audiofx.Main.setupVisualizerFxAndUI(Main.java:148)
08-29 16:24:50.233: E/AndroidRuntime(646):     at com.wjq.audiofx.Main.onCreate(Main.java:43)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.Activity.performCreate(Activity.java:4465)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
08-29 16:24:50.233: E/AndroidRuntime(646):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
08-29 16:24:50.233: E/AndroidRuntime(646):     ... 11 more

你可能感兴趣的:(android,模拟器)