Krishna Sharma
Krishna Sharma

Reputation: 2877

AbstractMethodError for LocationListener even app built with compileSdkVersion 30

Below exception is getting thrown for some devices which has Android 9 (API level 28).

Fatal Exception: java.lang.AbstractMethodError: abstract method "void android.location.LocationListener.onStatusChanged(java.lang.String, int, android.os.Bundle)"

With this cause seems I am missing some fundamental concepts, as per my assumption app shouldn't throw this exception as app built with compileSdkVersion 30 meaning that we don't need to override default methods defined in LocationListener.

Please help me to understand above issue.

If we had to override to avoid above issue then seems issues is with Android SDK.

EDIT : Here is the update from Google team

https://issuetracker.google.com/issues/190695723

Upvotes: 3

Views: 1440

Answers (3)

muhammed koç
muhammed koç

Reputation: 21

you use locationListenerCompat,later succesfully

Upvotes: 2

jvoyatz
jvoyatz

Reputation: 301

One solution is to override the onStatusChanged(), but you can also use the new LocationListenerCompat interface.

You can read this answer here for more details.

Upvotes: 0

Catur Ananta
Catur Ananta

Reputation: 92

I guess the issues is on Android SDK, on Sdk Version 29 below needed to override this.

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    
}

Upvotes: 0

Related Questions