gpt4 book ai didi

Android 应用程序在 2.3 设备上运行,在 4.1 上崩溃(重新发布)

转载 作者:行者123 更新时间:2023-11-30 03:59:40 33 4
gpt4 key购买 nike

我有一个 Android 应用程序可以在 2.3 版设备和一个特定的 4.1 模拟器上完美运行。它在其他 4.1 模拟器和 4.1 Google Nexus 设备上崩溃。

有什么想法吗?

这与尺寸、分辨率等有什么关系吗?

这是我在 4.1 模拟器上运行时的 logcat 输出。实际上代码很大,所以不能真正把它放在这里。任何提示都会很棒。然后我可以提供所需的代码 fragment 。

10-01 11:42:30.404: E/Trace(623): error opening trace file: No such file or directory (2) 
10-01 11:42:30.754: D/dalvikvm(623): GC_FOR_ALLOC freed 126K, 3% free 8126K/8327K, paused 42ms, total 44ms
10-01 11:42:30.794: D/AndroidRuntime(623): Shutting down VM
10-01 11:42:30.794: W/dalvikvm(623): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
10-01 11:42:30.804: E/AndroidRuntime(623): FATAL EXCEPTION: main
10-01 11:42:30.804: E/AndroidRuntime(623): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.example.android_compliance/com.example.android_compliance.MainActivity}: java.lang.NullPointerException
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.access$600(ActivityThread.java:130)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.os.Handler.dispatchMessage(Handler.java:99)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.os.Looper.loop(Looper.java:137)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-01 11:42:30.804: E/AndroidRuntime(623): at java.lang.reflect.Method.invokeNative(Native Method)
10-01 11:42:30.804: E/AndroidRuntime(623): at java.lang.reflect.Method.invoke(Method.java:511)
10-01 11:42:30.804: E/AndroidRuntime(623): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-01 11:42:30.804: E/AndroidRuntime(623): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-01 11:42:30.804: E/AndroidRuntime(623): at dalvik.system.NativeStart.main(Native Method)
10-01 11:42:30.804: E/AndroidRuntime(623): Caused by: java.lang.NullPointerException
10-01 11:42:30.804: E/AndroidRuntime(623): at com.example.android_compliance.MainActivity.onCreate(MainActivity.java:261)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.Activity.performCreate(Activity.java:5008)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
10-01 11:42:30.804: E/AndroidRuntime(623): ... 11 more
10-01 11:43:33.693: I/Process(623): Sending signal. PID: 623 SIG: 9

最佳答案

您是否尝试在 list 文件中应用应用的 SDK 版本范围?

例如像这样的行:

<uses-sdk android:minSdkVersion="7" android:maxSdkVersion="15"/>

关于Android 应用程序在 2.3 设备上运行,在 4.1 上崩溃(重新发布),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12702330/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com