Closed JannieT closed 1 week ago
This was done over 2 years ago.
see the CHANGELOG:
https://github.com/transistorsoft/flutter_background_fetch/blob/master/CHANGELOG.md#040---2019-12-17
My Flutter project is only upgraded to Android embedding v2 when I change to the following in AndroidManifest.xml
:
<application
android:name="${applicationName}"
>
<!-- code omitted -->
</application>
which caused me to run into this issue with 15K crashes in our installed user base, forcing me to quickly revert the change.
Maybe I am missing something. The latest stable Flutter expects to not see "io.flutter.app.FlutterApplication" referenced in the Android manifest and flutter_background_fetch requires it.
BackgroundFetch does not require anything about the reference of your Android Application class. It can be the Flutter default or a reference to your own custom class name.
Very interesting. Changing that name to the Flutter default caused a major regression in our app and I successfully resolved the issue by reverting back to "io.flutter.app.FlutterApplication" based on your final word on the issue which said:
Anyway. Good to know that things have since changed and it is now best to try some of the other solutions suggested in that issue thread. Would you now consider this workaround to be a good one instead? I just don't want to go against the explicit instructions of the package author. And what a fine package it is. Thank you so much for sharing it so generously.
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.2.1 21D62 darwin-x64, locale en-CA)
A freshly generated app's AndroidManifest
looks like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.foo1">
<application
android:label="foo1"
android:name="${applicationName}" <---
The Setup docs will be changed. If you are not providing a custom Application
class with android:name
, just leave it as is.
Actually, there are no Setup Instructions here that documented setting android:name="io.flutter.app.FlutterApplication"
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.
Strange that this is still needed. after such a long time no? Anybody an idea if there is a flutter issue open for this?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:
android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FlutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Build failed due to use of deprecated Android v1 embedding.
Strange that this is still needed
What is needed?
android:name="io.flutter.app.FlutterApplication"
Where are you directed to do that?
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
flutter_background_fetch
is now triggering deprecation warnings when an app is built with the latest stable Flutter release (v2.10.2)It will be great if users of this package can be allowed to upgrade to Android embedding v2 by following the official upgrade guide.
Currently the only safe way forward looks like having to downgrade to an older version of Flutter.