Android studio 2.3“Debug显示已连接和断开连接线,但两者之间没有” [英] Android studio 2.3 "Debug shows Connected and Disconnected lines but nothing in between"

查看:5557
本文介绍了Android studio 2.3“Debug显示已连接和断开连接线,但两者之间没有”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个物理设备上测试我的应用程序



在调试运行

 code>控制台

$ adb push C:\Users\arjun\AndroidStudioProjects\Scol\app\build\outputs\ap-\\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

成功


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

等待应用程序上线:com.example.arjun .scol | com.example.arjun.scol.test
等待应用程序上线:com.example.arjun.scol | com.example.arjun.scol.test

连接到com.example.arjun.scol
连接到目标VM,地址:'localhost:8600',transport:'socket'
与目标虚拟机断开连接,地址:'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。:语法错误(代码1):在编译时:CREATE TABLE IF NOT EXISTS teacer_homework(s.no。INTEGER AUTO INCREMENT,subject1 TEXT,subject2 TEXT,subject3 TEXT,subject4 TEXT,subject5 TEXT,subject6 TEXT,sub ject7 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)
在com.example.arjun.scol.SubjectSelection $ 2.onClick(SubjectSelection.java:59)
在android.view.View.performClick(View.java:4261)
在android.view.View $ PerformClick.run(View.java:17420)
在android.os.Handl er.handleCallback(Handler.java:615)
在android.os.Handler.dispatchMessage(Handler.java:92)
在android.os.Looper.loop(Looper.java:177)
在android.app.ActivityThread.main(ActivityThread.java:4944)
在java.lang.reflect.Method.invokeNative(本机方法)
在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


$ b $我已经编辑了运行配置,但是没有帮助...



我应该降级Android studio吗?

解决方案

转到运行 - >编辑配置



第二个选项卡Miscellaneous



检查项目自动显示logcat



更好的是检查项目启动前清除日志。 >

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


I'm testing my app in a physical device

On debug run

    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'

My app crashes due to error, but nothing is displayed in the debug console... this happened after updating android studio to 2.3..

But when I scroll through Android Monitor,I found the error messages

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

I had edited the run configuration too...but that didn't help...

Should i downgrade android studio?

解决方案

Go to Run -> Edit Configurations

Second tab "Miscellaneous"

Check item "Show logcat automatically"

it's better to check item "Clear log before launch", too.

and see logs and crashes in Android Monitor logcat

这篇关于Android studio 2.3“Debug显示已连接和断开连接线,但两者之间没有”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆