Open Leyfear opened 5 months ago
Can you try to add this on AndroidManifest.xml
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" android:minSdkVersion="34" />
let me know the result after
Can you try to add this on AndroidManifest.xml
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" android:minSdkVersion="34" />
let me know the result after
I just tried that and the error still pops.
The changes I made while using this package are:
Not sure of anything missed or put in wrong place, the app pops permissions request correctly, vpn connects just fine, but keeps poping that forground service error.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="id.laskarmedia.openvpn_flutter">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" android:minSdkVersion="34" />
<application
android:icon="@mipmap/ic_launcher">
<service
android:name="de.blinkt.openvpn.core.OpenVPNService"
android:foregroundServiceType="systemExempted"
android:exported="false"
tools:replace="android:exported" />
</application>
change it in package manifest
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" android:minSdkVersion="34" /> <application android:icon="@mipmap/ic_launcher"> <service android:name="de.blinkt.openvpn.core.OpenVPNService" android:foregroundServiceType="systemExempted" android:exported="false" tools:replace="android:exported" /> </application>
change it in package manifest
Problem solved
Still same error for Android 14+ after fix PR.
Error when show notification E/de.blinkt.openvpn.core.OpenVPNService( 9598): android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{45c0324 9598:com.example.flutter_application_1/u0a425} targetSDK=34