Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

Android Foreground Service “Application Not Responding”

I have an Android app with a foreground service which uses the accelerometer. After a few hours with the screen off, I turn the screen on and I shake the phone, but my app looks frozen (I see no changes in a notification which should change when I shake the phone), and I get an “Application Not Responding” dialog box. Here are the logs. Any help would be appreciated.

2021-01-22 20:10:47.443 1027-1062/? I/zygote: libdebuggerd_client: started dumping process 22315
2021-01-22 20:10:47.448 721-721/? I//system/bin/tombstoned: registered intercept for pid 22315 and type kDebuggerdJavaBacktrace
2021-01-22 20:10:47.448 22315-22325/com.example.myApp I/zygote: Thread[3,tid=22325,WaitingInMainSignalCatcherLoop,Thread*=0xa7f62c00,peer=0x13900100,"Signal Catcher"]: reacting to signal 3
2021-01-22 20:10:47.467 1027-1039/? I/zygote: Background concurrent copying GC freed 300226(13MB) AllocSpace objects, 65(2MB) LOS objects, 42% free, 21MB/37MB, paused 239us total 284.660ms

2021-01-22 20:10:47.588 721-721/? I//system/bin/tombstoned: received crash request for pid 22315
2021-01-22 20:10:47.588 721-721/? I//system/bin/tombstoned: found intercept fd 512 for pid 22315 and type kDebuggerdJavaBacktrace
2021-01-22 20:10:47.589 22315-22325/com.example.myApp I/zygote: Wrote stack traces to '[tombstoned]'
2021-01-22 20:10:47.589 1027-1062/? I/zygote: libdebuggerd_client: done dumping process 22315

2021-01-22 20:10:52.397 1027-1062/? E/ActivityManager: ANR in com.example.myApp
    PID: 22315
    Reason: executing service com.example.myApp/.myService
    Load: 14.97 / 14.37 / 14.16
    CPU usage from 1ms to 5557ms later (2021-01-22 20:10:46.795 to 2021-01-22 20:10:52.351):
      108% 22315/com.example.myApp: 100% user + 8.2% kernel / faults: 78929 minor 65 major
      39% 1027/system_server: 26% user + 12% kernel / faults: 5456 minor 469 major
      6.4% 1373/com.android.systemui: 4.8% user + 1.6% kernel / faults: 1065 minor 243 major
      4.1% 244/exe_cq: 0% user + 4.1% kernel
      0% 1682/com.lge.ims: 0% user + 0% kernel / faults: 2198 minor 617 major
      0.8% 1820/com.android.phone: 0.7% user + 0.1% kernel / faults: 1283 minor 243 major
      3.4% 1725/com.lge.systemserver: 2.6% user + 0.7% kernel / faults: 1367 minor 206 major
      3% 480/vendor.lge.hardware.sensors@1.0-service: 1.2% user + 1.7% kernel / faults: 18 minor
      0.6% 93/kswapd0: 0% user + 0.6% kernel
      2.6% 370/logd: 2.1% user + 0.5% kernel / faults: 27 minor 3 major
      0% 2239/com.lge.wifi.p2p: 0% user + 0% kernel / faults: 1912 minor 431 major
      2.3% 1344/com.android.server.telecom: 1.7% user + 0.5% kernel / faults: 1346 minor 329 major
      2.3% 2076/adbd: 0.5% user + 1.7% kernel / faults: 629 minor
      0% 1827/com.lge.wfcservice: 0% user + 0% kernel / faults: 2353 minor 472 major
      0.3% 1716/com.lge.lgdmsclientspr: 0.3% user + 0% kernel / faults: 1426 minor 430 major
      0% 1779/com.lge.sprintnativewfc.smf: 0% user + 0% kernel / faults: 1783 minor 384 major
      0% 2188/com.lge.atservice: 0% user + 0% kernel / faults: 1782 minor 377 major

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...