0

I'm using a Pi 3 with Android Things to operate some relays that control valves on an irrigation system. The system uses the internet to get a weather forecast to work how much water to use, and uses NanoHTTPD to provide a UI.

Some of the time it starts and it works fine, at other times I get all kinds of errors in the logs and often it won't start at all. I'm wondering if this is related to updates? What else could cause such unreliability? How can I iron these things out? I haven't changed any code recently.

Today, I have an error which I haven't seen before that means my app doesn't even start:

 --------- beginning of main
2019-02-07 10:53:38.175 297-314/system_process W/system_server: kill(-1814, 9) failed: No such process
2019-02-07 10:53:38.218 297-314/system_process I/chatty: uid=1000(system) ActivityManager identical 1 line
2019-02-07 10:53:38.258 297-314/system_process W/system_server: kill(-1814, 9) failed: No such process
2019-02-07 10:53:38.258 297-314/system_process I/system_server: Successfully killed process cgroup uid 10036 pid 1814 in 83ms
2019-02-07 10:53:38.626 1836-1836/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
2019-02-07 10:53:38.641 1836-1836/? W/app_process: Could not reserve sentinel fault page
2019-02-07 10:53:38.774 297-693/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.irrigator/.MainActivity} from uid 2000
2019-02-07 10:53:38.797 297-451/system_process I/ActivityManager: Start proc 1851:com.irrigator/u0a36 for activity com.irrigator/.MainActivity
2019-02-07 10:53:38.823 173-366/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-02-07 10:53:38.840 1851-1851/? I/zygote: Late-enabling -Xcheck:jni
2019-02-07 10:53:38.906 1836-1836/? I/app_process: The ClassLoaderContext is a special shared library.
2019-02-07 10:53:38.973 173-173/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-02-07 10:53:38.998 1836-1836/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
2019-02-07 10:53:39.001 297-308/system_process W/WindowManager: Permission Denial: dismissKeyguard from pid=1836, uid=2000 requires android.permission.CONTROL_KEYGUARD
2019-02-07 10:53:39.001 1836-1836/? D/AndroidRuntime: Shutting down VM
2019-02-07 10:53:42.386 297-453/system_process E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
2019-02-07 10:53:48.779 297-312/system_process W/ActivityManager: Launch timeout has expired, giving up wake lock!

Any help to deal with the current error would be appreciated, but also what can I do to make my app reliable?

Thanks

24 hours later: after following the advice below, I got the app working again, but this morning, it doesn't start again. These errors:

2019-02-08 09:24:07.137 2584-2584/? E/asset: setgid: Operation not permitted
2019-02-08 09:24:09.990 298-324/system_process E/PackageManager: Backup Manager not found!
2019-02-08 09:24:09.993 180-218/? E/installd: Failed to delete /data/app/vmdl1446360346.tmp: No such file or directory
2019-02-08 09:24:14.040 298-455/system_process E/TaskPersister: File error accessing recents directory (directory doesn't exist?).

The only file access I know I'm accessing is through Paper, but commenting this out, I still get the same error. Anyway, this illustrates my point about apparently fragile code.

  • It looks like the launch timeout is blocking launch. What are you doing for the on create? Maybe you should reduce the burden at the start of launch. – Nick Felker Feb 7 at 15:04
  • Thanks. I put some code in onCreate into a thread, and that fixed it. I don't understand why it used to work, and then it didn't, without me changing any code. – pir8ped Feb 8 at 6:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.