Skip to content

fix(Android): remove invalid onTimeout(int, int) override incompatible with compileSdk 34#267

Open
dmfdiogo wants to merge 1 commit into
Rapsssito:masterfrom
dmfdiogo:fix/android-onTimeout-api35-signature
Open

fix(Android): remove invalid onTimeout(int, int) override incompatible with compileSdk 34#267
dmfdiogo wants to merge 1 commit into
Rapsssito:masterfrom
dmfdiogo:fix/android-onTimeout-api35-signature

Conversation

@dmfdiogo
Copy link
Copy Markdown

Problem

The two-argument onTimeout(int startId, int fgsType) overload was introduced
in Android API 35 (VANILLA_ICE_CREAM). Using @Override against the default
compileSdkVersion 34 causes a compile error — the method does not exist in
the base android.app.Service class at that API level.

Fix

Remove the API-35-only overload. The existing onTimeout(int startId) already
calls stopSelf(startId), which is sufficient to stop the service on all
supported API levels.

…e with compileSdk 34

The two-argument onTimeout(int startId, int fgsType) overload was introduced
in Android API 35 (VANILLA_ICE_CREAM). Using @OverRide against compileSdkVersion 34
causes a compile error because the method does not exist in the base Service class.

Remove the overload and rely on the existing onTimeout(int startId) to call
stopSelf(startId), which provides the same behaviour across all supported API levels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant