Closed is10vmust closed 3 years ago
Your issue comes from io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onAttachedToEngine(FirebaseMessagingPlugin.java:62)
Provide the following files:
com.ensperity.projectcoronas.Application.kt
AndroidManifest.xml
My Application.kt
package com.ensperity.projectcoronas
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
import com.transistorsoft.flutter.backgroundgeolocation.FLTBackgroundGeolocationPlugin;
import com.transistorsoft.flutter.backgroundfetch.BackgroundFetchPlugin;
public class Application: FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
BackgroundFetchPlugin.setPluginRegistrant(this)
FlutterFirebaseMessagingService.setPluginRegistrant(this)
}
override fun registerWith(registry: PluginRegistry) {
FLTBackgroundGeolocationPlugin.setPluginRegistrant(this)
FirebaseCloudMessagingPluginRegistrant.registerWith(registry)
}
}
Please learn to use Github syntax highlighting.
I asked for 2 files, including AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.ensperity.projectcoronas">
<!--
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.
-->
<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.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<application tools:replace="android:label" android:name=".Application" android:label="Myapp" android:usesCleartextTraffic="true" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.transistorsoft.locationmanager.license" android:value="Redacted" />
<meta-data android:name="com.transistorsoft.locationmanager.ENCRYPTION_PASSWORD" android:value="" />
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
</manifest>
This line shows your app has been upgraded to flutter sdk >= 1.12
. You no longer need a custom Application.kt
.
<meta-data android:name="flutterEmbedding" android:value="2" />
See the Android Setup
Modify your AndroidManifest.xml
<application
+ android:name="io.flutter.app.FlutterApplication"
This line shows your app has been upgraded to flutter sdk
>= 1.12
. You no longer need a customApplication.kt
.<meta-data android:name="flutterEmbedding" android:value="2" />
See the Android Setup
Modify your
AndroidManifest.xml
<application + android:name="io.flutter.app.FlutterApplication"
i applied this changes and after that the background not worked at all
Then you must figure out that problem.
Do NOT use a custom Application.kt with Flutter sdk >= 1.12
This line shows your app has been upgraded to flutter sdk
>= 1.12
. You no longer need a customApplication.kt
.<meta-data android:name="flutterEmbedding" android:value="2" />
See the Android Setup Modify your
AndroidManifest.xml
<application + android:name="io.flutter.app.FlutterApplication"
i applied this changes and after that the background not worked at all
I also same issue? If your problem resolved Please Can you suggest me how to solve it?
I Ran the example application for iOS and when I kill the application, and try to open it again, the app crashes on startup. Any fixes for this?
Also, please let me know if you need more details.
My version is iOS 14.0 and using on IPhone XR
If the app crashes, provided the stacktrace here.
When launching through XCode it is okay, this only happens once you kill the app and then try to reopen it.
Here are the logs from the device for the example app
Incident Identifier: 61E75D87-D8DE-4A34-B2D6-86465315A518 CrashReporter Key: bd243a2ec0e9193d3e47b9dcc99ec8e558b91db9 Hardware Model: iPhone11,8 Process: Runner [18851] Path: /private/var/containers/Bundle/Application/BC0F6237-72AD-4FE9-97F1-BAF5A66EEDF4/Runner.app/Runner Identifier: com.transistorsoft.flutter.backgroundfetch.backgroundFetchExample Version: 1 (1.0.0) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.transistorsoft.flutter.backgroundfetch.backgroundFetchExample [2048]
Date/Time: 2020-07-09 07:38:48.2077 -0500 Launch Time: 2020-07-09 07:38:47.9566 -0500 OS Version: iPhone OS 14.0 (18A5301v) Release Type: Beta Baseband Version: 2.50.07 Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGKILL - CODESIGNING)
Exception Subtype: UNKNOWN_0x32 at 0x000000010ae81d60
VM Region Info: 0x10ae81d60 is in 0x10ae80000-0x10af00000; bytes after start: 7520 bytes before end: 516767
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
VM_ALLOCATE 10ae00000-10ae80000 [ 512K] r--/rwx SM=PRV
---> VM_ALLOCATE 10ae80000-10af00000 [ 512K] r-x/rwx SM=COW
MALLOC_LARGE 10af00000-10af10000 [ 64K] rw-/rwx SM=PRV
Termination Reason: Namespace CODESIGNING, Code 0x2 Triggered by Thread: 7
Termination Reason: Namespace CODESIGNING
Open your app in XCode and configure your code-signing as required.
Also see this that I found while googling "Termination Reason: Namespace CODESIGNING".
I do have XCode Automatically Signing for me as well. I am trying the release build to see if that works.
The release build works! But its interesting that if I close the app in debug mode, it crashes on restart. Will see if we can find a better solution for that. Otherwise I will work with the release build for now.
Thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.
Your Environment
flutter info
,flutter doctor
): fine no problemsMY LOGCAT
My Config
My Headless in foreground everything is ok but when i kill the app the headless run the code faster x10 this is my headless method:
Debug logs
W/FlutterEnginePluginRegistry(11730): Attempted to register plugin (io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry$ShimRegistrarAggregate@90a06e1) but it was already registered with this FlutterEngine (io.flutter.embedding.engine.FlutterEngine@a63ac06).
Additional context this happened after i set the switch event on my headless, then everything works fine and good but every time i killed the app the app crashed and stopped working , Many thanks