Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue start service at foreground when update targetSdk = 34 #276

Open
lambui09 opened this issue Jul 8, 2024 · 3 comments
Open

Issue start service at foreground when update targetSdk = 34 #276

lambui09 opened this issue Jul 8, 2024 · 3 comments

Comments

@lambui09
Copy link

lambui09 commented Jul 8, 2024

java.lang.RuntimeException: Unable to bind to service com.everfit.service.ExerciseService@bbeb578 with Intent {
Caused by: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { cmp=com.everfit.debug/com.everfit.service.ExerciseService }: app is in background uid UidRecord

@yschimke
Copy link
Contributor

yschimke commented Jul 8, 2024

Is it this change?

https://developer.android.com/training/wearables/versions/5/changes#exercise-recording-fgs-type

      <!-- If your app can also monitor location information, use
           android:foregroundServiceType="health|location" instead. -->
      <service
          android:name=".MyExerciseSessionRecorder"
          android:foregroundServiceType="health">
      </service>

@lambui09
Copy link
Author

lambui09 commented Jul 8, 2024

image
I update it, but same issue.

    <service
        android:name=".service.ExerciseService"
        android:enabled="true"
        android:exported="true"
        android:foregroundServiceType="health"
        android:permission="android.permission.FOREGROUND_SERVICE_HEALTH" />

@yschimke
Copy link
Contributor

yschimke commented Jul 8, 2024

Try this change #277

I'll see if we need to update the docs

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

No branches or pull requests

2 participants