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

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

Open
andrew2558 opened this issue Aug 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@andrew2558
Copy link

andrew2558 commented Aug 4, 2024

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 andrew2558 added the bug Something isn't working label Aug 4, 2024
@ncptuan
Copy link

ncptuan commented Sep 9, 2024

same issue
:(

@chaitanyak175
Copy link

I am also facing the same issue.

@smin9
Copy link

smin9 commented Sep 18, 2024

I had the same problem

1 similar comment
@mohamedabdallah09209
Copy link

I had the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants