android-studio - Android工作室2.3 "Debug shows Connected and Disconnected lines but nothing in between"

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

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

调试运行

    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'

我的应用程序因错误而崩溃,但调试控制台中没有显示任何内容...这是在将 android studio 更新到 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吗?

最佳答案

转到“运行”->“编辑配置”

第二个选项卡“其他”

勾选“自动显示logcat”

最好也检查“启动前清除日志”项。

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

关于android-studio - Android工作室2.3 "Debug shows Connected and Disconnected lines but nothing in between",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42576606/

相关文章:

javascript - 我无需 root 即可看到的任何内存文件夹的路径是什么? AndroidStudio

c# - 当 "break all"没有响应时,如何调试无响应的 .Net 服务?

javascript - 强制浏览器只刷新 1 个文件

android - 我如何记录这个异常?

android - 如何找出针对 Strictmode 策略违规采取的措施

android - 将 RecyclerView 和 Material Design 依赖项永久添加到 android studio 中的新项目

android - 无法解析项目 : CordovaLib

linq - 调试 LINQ to SQL SubmitChanges()

android - 当似乎有大量可用堆空间时,小分配会出现 OutOfMemoryError

gradle - 从APK移除资源文件