在模拟器上工作,而不是在设备或其他模拟器上工作。设定的目标是正确的[关闭]
Posted
技术标签:
【中文标题】在模拟器上工作,而不是在设备或其他模拟器上工作。设定的目标是正确的[关闭]【英文标题】:Working on emulator, not on the device or another emulator. The set target is correct [closed] 【发布时间】:2013-11-24 20:35:16 【问题描述】:这里是 logCat 文件:
11-25 01:53:50.047: E/Trace(26246): error opening trace file: No such file or directory (2)
11-25 01:53:50.057: D/ActivityThread(26246): setTargetHeapUtilization:0.25
11-25 01:53:50.057: D/ActivityThread(26246): setTargetHeapIdealFree:8388608
11-25 01:53:50.057: D/ActivityThread(26246): setTargetHeapConcurrentStart:2097152
11-25 01:53:50.117: D/androidRuntime(26246): Shutting down VM
11-25 01:53:50.117: W/dalvikvm(26246): threadid=1: thread exiting with uncaught exception (group=0x40ecf378)
11-25 01:53:50.127: E/AndroidRuntime(26246): FATAL EXCEPTION: main
11-25 01:53:50.127: E/AndroidRuntime(26246): java.lang.RuntimeException: Unable to create application my.app.cal.CalApplication: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4196)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.app.ActivityThread.access$1300(ActivityThread.java:138)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.os.Handler.dispatchMessage(Handler.java:99)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.os.Looper.loop(Looper.java:213)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.app.ActivityThread.main(ActivityThread.java:4787)
11-25 01:53:50.127: E/AndroidRuntime(26246): at java.lang.reflect.Method.invokeNative(Native Method)
11-25 01:53:50.127: E/AndroidRuntime(26246): at java.lang.reflect.Method.invoke(Method.java:511)
11-25 01:53:50.127: E/AndroidRuntime(26246): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
11-25 01:53:50.127: E/AndroidRuntime(26246): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
11-25 01:53:50.127: E/AndroidRuntime(26246): at dalvik.system.NativeStart.main(Native Method)
11-25 01:53:50.127: E/AndroidRuntime(26246): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:418)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:74)
11-25 01:53:50.127: E/AndroidRuntime(26246): at my.app.cal.CalApplication.readWeighingDetailFromDB(CalApplication.java:45)
11-25 01:53:50.127: E/AndroidRuntime(26246): at my.app.cal.CalApplication.onCreate(CalApplication.java:26)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
11-25 01:53:50.127: E/AndroidRuntime(26246): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4193)
11-25 01:53:50.127: E/AndroidRuntime(26246): ... 10 more
【问题讨论】:
请澄清您的具体问题或添加其他详细信息以准确突出您的需要。正如目前所写的那样,很难准确地说出你在问什么。 我正在制作一个在模拟器上运行的应用程序,但现在我试图在 4.1.2 平台的移动设备上运行它,它会立即收到强制关闭消息。我保留了所需的最低 SDK:API 11:Android 3.0(Honeycomb)和目标 SDK:API 18:Android 4.3。 我尝试将其更改为另一个模拟器,并且它也被强制关闭。 LogCat 与旧模拟器配合得很好。保留的模拟器都是 API 18 并具有 4.3 平台。谁能在这里解释一下 logcat 中发生了什么? 添加到这里..请立即帮助..***.com/questions/20225916/… 【参考方案1】:看起来 onCreate 事件中的 readWeightDeatilFromBD 类有问题!!
【讨论】:
以上是关于在模拟器上工作,而不是在设备或其他模拟器上工作。设定的目标是正确的[关闭]的主要内容,如果未能解决你的问题,请参考以下文章