我尝试在手机上启动Android应用程序(索尼爱立信Xperia Neo)。它正常启动,但是当我尝试打开它时,我看到一条消息说抱歉,您的应用程序意外停止,请再试一次并按下强制关闭。此外,安装的应用程序的大小只有820KB,但它必须是8-10MB。 顺便说一句,我的应用程序在平板电脑上运行良好,只在手机上出现问题 有帮助吗?谢谢。
这是logcat输出
01-12 18:09:59.345: D/dalvikvm(2402): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
01-12 18:09:59.345: W/dalvikvm(2402): VFY: unable to resolve instance field 17
01-12 18:09:59.345: D/dalvikvm(2402): VFY: replacing opcode 0x52 at 0x0012
01-12 18:09:59.345: D/dalvikvm(2402): VFY: dead code 0x0014-011f in Lcom/example/mis/MainActivity;.onCreate (Landroid/os/Bundle;)V
01-12 18:09:59.375: D/AndroidRuntime(2402): Shutting down VM
01-12 18:09:59.375: W/dalvikvm(2402): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
01-12 18:09:59.435: E/AndroidRuntime(2402): FATAL EXCEPTION: main
01-12 18:09:59.435: E/AndroidRuntime(2402): java.lang.NoSuchFieldError: android.content.res.Configuration.smallestScreenWidthDp
01-12 18:09:59.435: E/AndroidRuntime(2402): at com.example.mis.MainActivity.onCreate(MainActivity.java:59)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.os.Handler.dispatchMessage(Handler.java:99)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.os.Looper.loop(Looper.java:130)
01-12 18:09:59.435: E/AndroidRuntime(2402): at android.app.ActivityThread.main(ActivityThread.java:3701)
01-12 18:09:59.435: E/AndroidRuntime(2402): at java.lang.reflect.Method.invokeNative(Native Method)
01-12 18:09:59.435: E/AndroidRuntime(2402): at java.lang.reflect.Method.invoke(Method.java:507)
01-12 18:09:59.435: E/AndroidRuntime(2402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
01-12 18:09:59.435: E/AndroidRuntime(2402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
01-12 18:09:59.435: E/AndroidRuntime(2402): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:1)
错误是指smallestScreenWidthDp
,这是Android 3.2中引入的内容。你说你的手机正在运行Android 2.3.4,所以你正在调用某种代码或在你的Manifest文件中配置导致错误的东西。