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

Restart service on device reboot is not working on android 12 #345

Open
kotran88 opened this issue Aug 6, 2022 · 0 comments
Open

Restart service on device reboot is not working on android 12 #345

kotran88 opened this issue Aug 6, 2022 · 0 comments

Comments

@kotran88
Copy link

kotran88 commented Aug 6, 2022

it works very well on background and even app is killed.
but when I reboot android phone then it cause error saying
backgound_locator_example is keep shut down.

무제

my android manifext.xml is as below

`

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>


<!-- io.flutter.app.FlutterApplication is an android.app.Application that
     calls FlutterMain.startInitialization(this); in its onCreate method.
     In most cases you can leave this as-is, but you if you want to provide
     additional functionality it is fine to subclass or reimplement
     FlutterApplication and put your custom class here. -->
<application
    android:label="background_locator_example"
    android:name="${applicationName}"
    android:requestLegacyExternalStorage="true"
    android:icon="@mipmap/ic_launcher"
    android:allowBackup="false"
    >
    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize"
        >
        <meta-data
            android:name="io.flutter.embedding.android.SplashScreenDrawable"
            android:resource="@drawable/launch_background" />
        <meta-data
            android:name="io.flutter.embedding.android.NormalTheme"
            android:resource="@style/NormalTheme"
            />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <receiver android:name="rekab.app.background_locator.BootBroadcastReceiver"
    android:exported="false"
        android:enabled="true">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
        </intent-filter>
    </receiver>
    <service
        android:name="rekab.app.background_locator.IsolateHolderService"
        android:permission="android.permission.FOREGROUND_SERVICE"
        android:exported="false"
        android:foregroundServiceType = "location"
        />

    <meta-data android:name="flutterEmbedding" android:value="2"/>

</application>
`
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

1 participant