5

I have had this problem in the past and I didn't think much of it as I was only just experimenting with the IDE. However, I have realized the error also shows up when I create a fresh new application, even when I have added no code of my own I still get this error, any help would be appreciated to fix this issue.

So far i have tried to run methods on the UI thread as well as an asynchronous thread, but still no luck.

error:

E/AbstractTracker: Can't create handler inside thread that has not called Looper.prepare()

D/AppTracker: App Event: stop

E/AbstractTracker: Can't create handler inside thread that has not called Looper.prepare()

D/AppTracker: App Event: start

Community
  • 1
  • 1
Ashraf Rahman
  • 467
  • 1
  • 5
  • 9
  • Please provide a [mcve]. This would include the full Java stack trace for your error (not just this line) and the Java code that is raising this error (e.g., the `AbstractTracker` class). – CommonsWare Aug 22 '17 at 22:02
  • the problem is that, thats all i get regarding the error: E/AbstractTracker: Can't create handler inside thread that has not called Looper.prepare() D/AppTracker: App Event: stop E/AbstractTracker: Can't create handler inside thread that has not called Looper.prepare() D/AppTracker: App Event: start – Ashraf Rahman Aug 23 '17 at 16:53
  • OK, then what evidence do you have that this has anything to do with your app? Is the message coming from your process? – CommonsWare Aug 23 '17 at 16:54
  • When i launch the application to test, the error keeps showing up in the android monitor, even when i JUST set up the application. – Ashraf Rahman Aug 24 '17 at 09:18
  • 2
    So? That does not mean that the error is coming from your process. You know your process ID, as Android Studio shows that to you. You know the process ID of the messages, as Android Studio shows that to you as well. Are the values the same? When you run your app elsewhere (e.g., another device, an emulator), do you see these messages? My guess is that this is coming from something on a specific device, set up by the device manufacturer. – CommonsWare Aug 24 '17 at 09:59
  • 2
    I second what CommonsWare says. I have a OnePlus One and it tends to do that as well. Its a manufacturer issue, I reckon. – solidak Oct 19 '17 at 14:38
  • 2
    I am getting the same error. But works on my 1Plus1... but fails on my 1Plus2! driving me Nuts – user3833732 Dec 03 '17 at 17:00
  • I am also getting it on my OnePlus3T. – Farrukh Najmi Sep 23 '19 at 20:44

1 Answers1

0

There are not enough details on the type of service or features that you are using in your question.

But I have observed this happens when you use a new SDK and run the app on OnePlus One/Two.

You would need to use a lower SDK (<28) and set the minimum SDK to 16.

Also if you are using DeviceAdminPermission or any built-in interface to receive Broadcast then remove UserHandler as an argument. This argument is added in SDK 29 and it creates a separate thread.

Srihari Karanth
  • 2,067
  • 2
  • 24
  • 34