【问题标题】:Android studio 2.3 "Debug shows Connected and Disconnected lines but nothing in between"Android studio 2.3“调试显示连接和断开的线路,但中间没有”
【发布时间】:2017-07-23 10:18:18
【问题描述】:

我正在物理设备上测试我的应用

在调试运行时

    Console 

$ adb push C:\Users\arjun\AndroidStudioProjects\Scol\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.example.arjun.scol
$ adb shell pm install -r "/data/local/tmp/com.example.arjun.scol"
    pkg: /data/local/tmp/com.example.arjun.scol

Success


$ adb shell am start -n "com.example.arjun.scol/com.example.arjun.scol.login.Login" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D

Waiting for application to come online: com.example.arjun.scol | com.example.arjun.scol.test
Waiting for application to come online: com.example.arjun.scol | com.example.arjun.scol.test

Connecting to com.example.arjun.scol
Connected to the target VM, address: 'localhost:8600', transport: 'socket'
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

我的应用程序因错误而崩溃,但debug console 中没有显示任何内容...这是在updating android studio to 2.3 之后发生的...

但是当我滚动浏览Android Monitor时,我发现了错误消息

03-05 12:50:40.380 6608-6608/com.example.arjun.scol E/AndroidRuntime: FATAL EXCEPTION: main
                                                                     android.database.sqlite.SQLiteException: near ".": syntax error (code 1): , while compiling: CREATE TABLE IF NOT EXISTS teacer_homework(s.no. INTEGER AUTO INCREMENT, subject1 TEXT, subject2 TEXT, subject3 TEXT, subject4 TEXT, subject5 TEXT, subject6 TEXT, subject7 TEXT, date TEXT );
 at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1108)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:681)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:589)
  at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
  at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1769)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1700)
at com.example.arjun.scol.database.MyDBHandler.classhomework(MyDBHandler.java:246)
at com.example.arjun.scol.SubjectSelection$2.onClick(SubjectSelection.java:59)
at android.view.View.performClick(View.java:4261)
at android.view.View$PerformClick.run(View.java:17420)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:177)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
0

我也编辑了运行配置...但这没有帮助...

我应该降级 android studio 吗?

【问题讨论】:

  • 看看Android Monitor 部分。有什么吗?
  • @Luca Nicoletti 是的..我在那里看到那些条目...如何在调试控制台中显示它?
  • 在调试控制台上你什么也看不到?完全没有错误?您使用的是哪种设备?它有自定义 ROM 吗?
  • @Luca Nicoletti 我正在使用三星 Galaxy Star Duos。在将 android studio 更新到 2.3 之前,我没有任何问题。

标签: android-studio debugging android-logcat android-debug android-monitor


【解决方案1】:

转到运行 -> 编辑配置

第二个标签“杂项”

勾选“自动显示logcat”项

最好也勾选“启动前清除日志”项。

并在 Android Monitor logcat 中查看日志和崩溃

【讨论】:

    【解决方案2】:

    查看菜单栏并转到运行 → 编辑配置。

    选择第二个标签“其他”。

    勾选“自动显示logcat”和“启动前清除日志”。

    【讨论】:

      【解决方案3】:

      试用文件 -> 使缓存无效并重新启动 它对我有用

      【讨论】:

        【解决方案4】:

        转到文件/设置/构建、执行、部署/即时运行, 启用额外记录...

        现在您已登录 Android Monitor 选项卡 (alt+6)

        【讨论】:

        • 我必须向上滚动很长时间才能看到错误消息。启用即时运行不允许我的应用运行。
        • 也许删除模拟器并构建一个新的会有所帮助
        猜你喜欢
        • 2017-07-29
        • 2015-10-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-10-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多