当我在调试模式下运行时,应用程序崩溃了,但是当我正常运行它时它会起作用.我认为附加调试器时会出现问题.
日志:
A/art: art/runtime/jdwp/jdwp_event.cc:661] Check failed: Thread::Current() != GetDebugThread() (Thread::Current()=0x7f44a18400, GetDebugThread()=0x7f44a18400) Expected event thread
A/art: art/runtime/runtime.cc:422] Runtime aborting...
A/art: art/runtime/runtime.cc:422] Aborting thread:
A/art: art/runtime/runtime.cc:422] "JDWP" prio=5 tid=4 WaitingForDebuggerSend
A/art: art/runtime/runtime.cc:422] | group="" sCount=0 dsCount=0 obj=0x12c60280 self=0x7f44a18400
A/art: art/runtime/runtime.cc:422] | sysTid=24137 nice=0 cgrp=default sched=0/0 handle=0x7f4b904450
A/art: art/runtime/runtime.cc:422] | state=R schedstat=( 132066712 16401043 106 ) utm=9 stm=2 core=3 HZ=100
A/art: art/runtime/runtime.cc:422] | stack=0x7f4b80a000-0x7f4b80c000 stackSize=1005KB
A/art: art/runtime/runtime.cc:422] | held mutexes= "abort lock"
A/art: art/runtime/runtime.cc:422] native: #00 pc 000000000047e2cc /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220)
A/art: …Run Code Online (Sandbox Code Playgroud) debugging android android-debug android-studio android-debugging
在Eclipse上用Java开发的Android(4.2.2)应用程序,我遇到了崩溃,但我无法弄清楚代码中是什么导致它...
堆栈跟踪不引用任何我自己的源代码...
线程[<1> main](Suspended(异常RuntimeException))
ActivityThread.performLaunchActivity(ActivityThread $ ActivityClientRecord,Intent)行:2255
ActivityThread.handleLaunchActivity(ActivityThread $ ActivityClientRecord,Intent)行:2309 ActivityThread.access $ 700(ActivityThread,ActivityThread $ ActivityClientRecord ,Intent)行:157
ActivityThread $ H.handleMessage(消息)行:1289
ActivityThread $ H(Handler).dispatchMessage(消息)行:99 Looper.loop()行:176 ActivityThread.main(String [])行:5317
Method.invokeNative(Object,Object [],Class,Class [],Class,int,boolean)line:not available [native method] Method.invoke(Object,Object ...)行:511 ZygoteInit $ MethodAndArgsCaller.run( )行:1102 ZygoteInit.main(String [])行:869 NativeStart.main(String [])行:不可用[native method]
...我在我的应用程序中启动了几个活动,并且所有这些活动都包含在try/catch中,但是如果我在catch块中设置了断点,那么它们就不会被击中,如果我跳过启动活动的代码,似乎没有什么似乎不妥.系统也没有向Logcat写任何异常(在Logcat上没有过滤器,完整的详细输出).
点击上面的行就会给我"找不到来源".有没有办法看到它试图启动的Activity或异常的性质是什么?
所以当我使用新的 API 时,我通常会收到这种典型的错误消息
com.squareup.moshi.JsonDataException: Required value 'X' (JSON name 'x') missing at $
at com.squareup.moshi.internal.Util.missingProperty(Util.java:649)
at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:103)
at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:46)
at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:27)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:153)
at okhttp3.RealCall$AsyncCall.run(RealCall.kt:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Run Code Online (Sandbox Code Playgroud)
我想知道一种方法来准确调试此调用返回的内容。例如,如果它缺少参数“X”,那么我想知道它是否为空或者是否返回一些数据。
已经尝试过日志拦截器,但我认为我没有正确设置它。有什么确切的方法来调试此调用返回的确切数据是什么?
解决方案:我认为使用Web调试器是唯一的方法(例如Charles Proxy)
我被别人开发的项目困住了。它是一个非常大的应用程序。因此,为了理解代码,我想知道流程,基本上是当前在我的手机上运行的活动的名称(代码中的java文件)。我可以在所有活动中设置断点,但是还有其他方法吗?
为了从Android Studio 3.0为调试Android应用程序提供构建,它不会安装在具有Marshmallow及更高版本的Mobile中(在未经测试的Lollipop中).我已经使用了Stack溢出的最大解决方案,但它无法正常工作.它始终显示App Not Installed.
当我开始在Android Studio 3.0中调试我的应用程序并打开Logcat时,它显示了很多消息和警告,但问题是,它永远不会停止,即使调试完成并且应用程序终止,它仍会打印这么多消息不断.有谁可以帮忙???
android android-logcat android-debug android-debugging android-studio-3.0
我知道我们可以按Ctrl+ F2来分离调试器但是有没有在android studio中附加调试器的快捷方式?
我正在64位linux上工作,需要为我的aarch64 Android手机构建gdbserver。NDK中有预构建的gdbserver ,但它使用NDK包中的python,而不是使用我的系统python,我无法安装其他python插件。
如何找到需要哪个--target和参数?我尝试了和 google 之类的“build gdbserver aarch64”或“gdbserver configure android”,但没有找到 aarch64 Android 的任何答案。--host./configure--help
对于gdb我可以使用./configure --enable-targets=all,但是有什么用gdbserver呢?是否有所有可用参数的“列表”?
这是我尝试构建gdbserver 的方法
CC=arm-none-eabi-gcc, CXX=arm-none-eabi-g++,使可执行文件在 PATH 中可用 ../configure
../configure --host=aarch64-linux --target=aarch64-linux-androideabi
../configure --host=aarch64-linux-androideabi --target=aarch64-linux
../configure --host=aarch64-linux-androideabi --target=aarch64-linux-androideabi
Run Code Online (Sandbox Code Playgroud)
...
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/opt/gdb-9.1/gdb/gdbserver/build/build-libiberty-gdbserver/testsuite'
make[2]: Leaving directory '/opt/gdb-9.1/gdb/gdbserver/build/build-libiberty-gdbserver'
make[1]: Leaving directory '/opt/gdb-9.1/gdb/gdbserver/build'
make: *** No rule to make target …Run Code Online (Sandbox Code Playgroud)