flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

android api 34, sendCancelIfRunning: isInProgress=falsecallback=io.flutter.embedding.android.FlutterActivity

Open andrew2558 opened this issue 6 months ago • 3 comments

Android API 34 Describe the bug When I use flutter_downloader to download files in flutter, the following information is displayed in the android emulator

W/WindowOnBackDispatcher( 5234): sendCancelIfRunning: isInProgress=falsecallback=io.flutter.embedding.android.FlutterActivity$1@98a3d9

flutter code:

FlutterDownloader.cancelAll();

      final taskId = await FlutterDownloader.enqueue(
        url: url,
        savedDir: savedDir,
        fileName: fileName,
        showNotification: true,
        saveInPublicStorage: true,
        openFileFromNotification: false,
      );

      FlutterDownloader.registerCallback(_downloadCallback);

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="aaa">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <!-- <uses-permission android:name="android.permission.READ_PHONE_STATE"/> -->

    <!-- <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> -->

    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    
    <application
        android:label="aaa"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:enableOnBackInvokedCallback="true"
        android:requestLegacyExternalStorage="true">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            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">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <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>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />

        <provider
            android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
            android:authorities="${applicationId}.flutter_downloader.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"/>
        </provider>
       
    </application>
</manifest>

There is no other information and the callback function is not called I have no idea where I'm going wrong, can anyone provide some help?

andrew2558 avatar Aug 04 '24 09:08 andrew2558