Rapsssito / react-native-background-actions

React Native background service library for running background tasks forever in Android & iOS.
MIT License
818 stars 117 forks source link

Background service not starting on Android #209

Closed apapalillo closed 5 months ago

apapalillo commented 10 months ago

Hi everybody

I encountered an issue in the past days. After upgrading RN to 0.72 the background service wasn't starting anymore

After hours of debugging I figured out I needed to add an exclusion in the proguard file:

# React Native Background Actions
-keep public class com.asterinet.react.bgactions.** {*;}

Best regards!

pmdev71 commented 10 months ago

I think the service is not automatically added, so you'll need to add it in your AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
    ...
    <service android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask" />
   ...
  </application>
</manifest>
apapalillo commented 10 months ago

I think the service is not automatically added, so you'll need to add it in your AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
    ...
    <service android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask" />
   ...
  </application>
</manifest>

Hi pmdev71, thanks for your feedback. I also thought it could be a manifest issue, but I found out it was already correctly declared in there. Only the proguard rule fixed the issue for me.

Ivandeclei commented 9 months ago

i have same problem, the message is

FAILURE: Build failed with an exception.

github-actions[bot] commented 5 months ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: