4

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?

arjun
  • 69
  • 1
  • 6
  • Have a look at `Android Monitor` section. Anything there? – Luca Nicoletti Mar 03 '17 at 10:42
  • @Luca Nicoletti yes..I see those entries there...How to display it in debug console? – arjun Mar 03 '17 at 11:02
  • And on debug console you don't see anything? No errors at all? Which device are you using? Does it has a custom ROM? – Luca Nicoletti Mar 03 '17 at 11:10
  • @Luca Nicoletti I'm using samsung galaxy star duos.Before updating android studio to 2.3, I had no problems. – arjun Mar 03 '17 at 11:15
  • See also: http://stackoverflow.com/questions/42574428/debug-console-doesnt-show-messages-after-upgrading-android-studio-to-2-3 – Brian Mar 03 '17 at 16:05
  • 1
    Possible duplicate of [Log.d reports not showing up after Android Studio 2.3 Update](http://stackoverflow.com/questions/42581935/log-d-reports-not-showing-up-after-android-studio-2-3-update) – rene Mar 04 '17 at 14:34

4 Answers4

6

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

Alireza Noorali
  • 3,129
  • 2
  • 33
  • 80
0

Look at menu bar and go to Run → Edit Configurations.

Select the second tab, "Miscellaneous".

Check "Show logcat automatically" and "Clear log before launch".

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
0

Try out File -> invalidate cache and restart It worked out for me

-1

go to File / Setting / Build, Execution, Deployment / Instant Run , enable Log extra ...

now you have the log in Android Monitor tab (alt+6)

Meisam
  • 358
  • 5
  • 14