Flutter flashes black screen on Android when resuming

WORKAROUND: https://github.com/flutter/flutter/issues/59552#issuecomment-737767770
We modify the default flutter example app to simulate "heavy work":
void main() {
  Timer.periodic(const Duration(milliseconds: 1), (_) {
    sleep(const Duration(milliseconds: 500));
  });

  runApp(MyApp());
}

On Android, sending the app to background and then back to foreground, the app is entirely black for ~500ms.
[✓] Flutter (Channel unknown, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-DE)
    • Flutter version 1.17.0 at /Users/darolf/dev/flutter
    • Framework revision d3ed9ec945 (2 months ago), 2020-04-06 14:07:34 -0700
    • Engine revision c9506cb8e9
    • Dart version 2.8.0 (build 2.8.0-dev.18.0 eea9717938)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/darolf/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/darolf/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.46.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

[✓] Connected device (2 available)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)
    • macOS                        • macOS         • darwin-x64  • Mac OS X 10.15.4 19E287

• No issues found!

The same problem.

i have a similar issue, but I don't understand what is happening and how ti fix it.
There is doctor log and video demonstration.
[✓] Flutter (Channel master, 1.21.0-6.0.pre.141, on Mac OS X 10.15.5 19F101, locale en-RU)
    • Flutter version 1.21.0-6.0.pre.141 at /Users/ni/work/flutter
    • Framework revision c748f1a7aa (2 days ago), 2020-07-31 17:45:18 -0700
    • Engine revision 280bbfc763
    • Dart version 2.10.0 (build 2.10.0-2.0.dev bd528bfbd6)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/ni/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.0

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2020.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 47.1.3
    • Dart plugin version 201.7846.93

[✓] VS Code (version 1.47.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[✓] Connected device (1 available)
    • Mi A1 (mobile) • d552def70404 • android-arm64 • Android 9 (API 28)

Same problem here, looks like it happens on every flutter app.
Video demo https://drive.google.com/file/d/1lX83DgrUEohZFmesWisRK878CQYA5MsG/view?usp=sharing
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en-BR)
    • Flutter version 1.17.5 at /Users/felipe/development/flutter
    • Framework revision 8af6b2f038 (5 weeks ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/felipe/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[!] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.47.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[✓] Connected device (1 available)
    • moto g 6 plus •<PHONE_NUMBER> • android-arm64 • Android 9 (API 28)

! Doctor found issues in 1 category.

If someone is looking for a reliable workaround, here's a good old magic trick. All smokes and mirrors!
In your Flutter Activity, do:

Override getTransparencyMode and return TransparencyMode.transparent
Override setContentView to wrap the view into a container: FrameLayout
Override onFlutterSurfaceViewCreated and remember the flutterSurfaceView
Override onPause, create a screenshot of the flutterSurfaceView and set this as the background of your container

Basically, we take a screenshot of the app when the app is sent to background. When the app comes back again, instead of seeing a black background, the user will see the screenshot.

i found simple solution:
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

code sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: Center(
        child: Container(
          child: Text('Hello World'),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B29 darwin-x64, locale
    en-GB)
    • Flutter version 1.22.4 at /Users/tahatesser/Code/flutter_stable
    • Framework revision 1aafb3a8b9 (7 days ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (2 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554             •
      android-x64 • Android 9 (API 28) (emulator)
    • Taha’s iPad (mobile)                  • 00008020-000255113EE8402E • ios
      • iOS 14.2

! Doctor found issues in 1 category.

[✓] Flutter (Channel master, 1.24.0-8.0.pre.321, on macOS 11.0.1 20B29
    darwin-x64, locale en-GB)
    • Flutter version 1.24.0-8.0.pre.321 at
      /Users/tahatesser/Code/flutter_master
    • Framework revision 05dadb0120 (7 hours ago), 2020-11-20 07:33:05 +0530
    • Engine revision a0da844845
    • Dart version 2.12.0 (build 2.12.0-50.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (5 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554             •
      android-x64    • Android 9 (API 28) (emulator)
    • Taha’s iPad (mobile)                  • 00008020-000255113EE8402E • ios
      • iOS 14.2
    • macOS (desktop)                       • macos                     •
      darwin-x64     • macOS 11.0.1 20B29 darwin-x64
    • Web Server (web)                      • web-server                •
      web-javascript • Flutter Tools
    • Chrome (web)                          • chrome                    •
      web-javascript • Google Chrome 87.0.4280.67

• No issues found!

Hi @frcc00
I tried your method but I couldn't run
Log
Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 5): 'configureFlutterEngine' overrides nothing
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 42): Unresolved reference: nonnull
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 65): Unresolved reference: FlutterEngine
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (7, 9): Unresolved reference: GeneratedPluginRegistrant
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (10, 39): Unresolved reference: FlutterActivityLaunchConfigs
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (11, 16): Unresolved reference: BackgroundMode

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Hi @frcc00
I tried your method but I couldn't run
Log
Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 5): 'configureFlutterEngine' overrides nothing
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 42): Unresolved reference: nonnull
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 65): Unresolved reference: FlutterEngine
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (7, 9): Unresolved reference: GeneratedPluginRegistrant
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (10, 39): Unresolved reference: FlutterActivityLaunchConfigs
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (11, 16): Unresolved reference: BackgroundMode

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

i see，u miss import headers, open in androidstuido ,and alt+enter will help

Hi @frcc00
I tried your method but I couldn't run
Log
Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 5): 'configureFlutterEngine' overrides nothing
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 42): Unresolved reference: nonnull
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (6, 65): Unresolved reference: FlutterEngine
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (7, 9): Unresolved reference: GeneratedPluginRegistrant
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (10, 39): Unresolved reference: FlutterActivityLaunchConfigs
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (11, 16): Unresolved reference: BackgroundMode

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

i see，u miss import headers, open in androidstuido ,and alt+enter will help

i updated my comment

@frcc00
Log
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (13, 42): Unresolved reference: nonnull

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

@frcc00
Log
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (13, 42): Unresolved reference: nonnull

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

try add
dependencies {
implementation 'com.android.support:support-annotations:28.0.0'
}
in your build.gradle

FlutterFragmentActivity

Hi, thanks to share your solution, but i don't have this class
package xx.xxx.xxx

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

which path and class we must put your code? thanks in advance

REOPEN

@TahaTesser
Reopen issue again please

@frcc00
Log
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
e: /Users/chiuhol/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (13, 42): Unresolved reference: nonnull

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

u can check this link https://developer.android.com/jetpack/androidx/migrate
And change the line with notnull from:
override fun configureFlutterEngine(@nonnull flutterEngine: FlutterEngine) {
to:
   override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {

Here are some fragments to fix it:
package smokeAndMirrors

import android.graphics.Bitmap
import android.graphics.Color
import android.os.Handler
import android.view.PixelCopy
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterSurfaceView
import io.flutter.embedding.android.TransparencyMode

class MainActivity : FlutterActivity() {
    // hook into pause to create a screenshot of the UI
    override fun onPause() {
        val uiScreenshot = this.uiScreenshot ?: return
        val uiSurfaceView = this.flutterSurfaceView ?: return

        screenshotToken++

        val uiBitmap = Bitmap.createBitmap(uiSurfaceView.width, uiSurfaceView.height, Bitmap.Config.ARGB_8888)
        uiScreenshot.setImageBitmap(uiBitmap)
        try {
            PixelCopy.request(
                    uiSurfaceView, uiBitmap, {},
                    Handler()
            )
        } catch (e: IllegalArgumentException) {
        }

        super.onPause()
    }

    // hook into resume to remove the screenshot (free up resources)
    override fun onResume() {
        super.onResume()

        val delay = 500L  // give a bit of time for the Flutter UI to render the first frame
        val screenshotToken = screenshotToken // don't increment token here!!!

        Handler().postDelayed({
            // ^ASYNC: still the same token?
            if (screenshotToken == this.screenshotToken) {
                uiScreenshot?.setImageDrawable(null)
            }
        }, delay)
    }

    // hook to place the container that contains the uiScreenshot layered below Flutter's UI view
    override fun setContentView(view: View) {
        uiScreenshot = ImageView(context)
        container = FrameLayout(this).also {
            it.setBackgroundColor(Color.WHITE)
            it.addView(uiScreenshot)
            it.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT))
            super.setContentView(it)
        }
    }

    // hook to remember the surface for taking screenshots
    override fun onFlutterSurfaceViewCreated(flutterSurfaceView: FlutterSurfaceView) {
        super.onFlutterSurfaceViewCreated(flutterSurfaceView)
        this.flutterSurfaceView = flutterSurfaceView
    }

    // make the Flutter UI transparent to see the screenshot behind it
    override fun getTransparencyMode(): TransparencyMode = TransparencyMode.transparent

    // this container will wrap the uiScreenshot + Flutter's UI view
    private var container: FrameLayout? = null

    // UI screenshot taken in onPause
    private var uiScreenshot: ImageView? = null

    // token to guard against async race conditions
    private var screenshotToken = 0

    // the surface that Flutter uses to draw the UI
    private var flutterSurfaceView: FlutterSurfaceView? = null
}

i found simple solution, and It doesn't cause any other problems:
import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivityLaunchConfigs
import io.flutter.embedding.android.FlutterActivityLaunchConfigs.BackgroundMode
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

Unfortunately workaround does not work for me.
Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-RU)

i found simple solution, and It doesn't cause any other problems:
import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivityLaunchConfigs
import io.flutter.embedding.android.FlutterActivityLaunchConfigs.BackgroundMode
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

Unfortunately workaround does not work for me.
Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-RU)

Try https://github.com/flutter/flutter/issues/59552#issuecomment-737767770

i found simple solution, and It doesn't cause any other problems:
import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivityLaunchConfigs
import io.flutter.embedding.android.FlutterActivityLaunchConfigs.BackgroundMode
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

Unfortunately workaround does not work for me.
Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-RU)

Try #59552 (comment)

I don't think that it is a good idea to do this way. Actually I believe that someday the fix will be in framework :)

i found simple solution, and It doesn't cause any other problems:
import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivityLaunchConfigs
import io.flutter.embedding.android.FlutterActivityLaunchConfigs.BackgroundMode
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

Unfortunately workaround does not work for me.
Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-RU)

Try #59552 (comment)

I don't think that it is a good idea to do this way. Actually I believe that someday the fix will be in framework :)

😂😂😂

Here is a working solution that takes a screenshot of the UI and puts it behind the transparent Flutter UI to conceal the "missing frame" when resuming.
UPVOTE IF IT WORKS FOR YOU!
package smokeAndMirrors

import android.graphics.Bitmap
import android.graphics.Color
import android.os.Handler
import android.view.PixelCopy
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterSurfaceView
import io.flutter.embedding.android.TransparencyMode

class MainActivity : FlutterActivity() {
    // hook into pause to create a screenshot of the UI
    override fun onPause() {
        val uiScreenshot = this.uiScreenshot ?: return
        val uiSurfaceView = this.flutterSurfaceView ?: return

        screenshotToken++

        val uiBitmap = Bitmap.createBitmap(uiSurfaceView.width, uiSurfaceView.height, Bitmap.Config.ARGB_8888)
        uiScreenshot.setImageBitmap(uiBitmap)
        try {
            PixelCopy.request(
                    uiSurfaceView, uiBitmap, {},
                    Handler()
            )
        } catch (e: IllegalArgumentException) {
        }

        super.onPause()
    }

    // hook into resume to remove the screenshot (free up resources)
    override fun onResume() {
        super.onResume()

        val delay = 500L  // give a bit of time for the Flutter UI to render the first frame
        val screenshotToken = screenshotToken // don't increment token here!!!

        Handler().postDelayed({
            // ^ASYNC: still the same token?
            if (screenshotToken == this.screenshotToken) {
                uiScreenshot?.setImageDrawable(null)
            }
        }, delay)
    }

    // hook to place the container that contains the uiScreenshot layered below Flutter's UI view
    override fun setContentView(view: View) {
        uiScreenshot = ImageView(context)
        container = FrameLayout(this).also {
            it.setBackgroundColor(Color.WHITE)
            it.addView(uiScreenshot)
            it.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT))
            super.setContentView(it)
        }
    }

    // hook to remember the surface for taking screenshots
    override fun onFlutterSurfaceViewCreated(flutterSurfaceView: FlutterSurfaceView) {
        super.onFlutterSurfaceViewCreated(flutterSurfaceView)
        this.flutterSurfaceView = flutterSurfaceView
    }

    // make the Flutter UI transparent to see the screenshot behind it
    override fun getTransparencyMode(): TransparencyMode = TransparencyMode.transparent

    // this container will wrap the uiScreenshot + Flutter's UI view
    private var container: FrameLayout? = null

    // UI screenshot taken in onPause
    private var uiScreenshot: ImageView? = null

    // token to guard against async race conditions
    private var screenshotToken = 0

    // the surface that Flutter uses to draw the UI
    private var flutterSurfaceView: FlutterSurfaceView? = null
}

There is something wrong with this code. When set TransparencyMode to TransparencyMode.transparent, Flutter will use TextureView instead of SurfaceView. So that onFlutterSurfaceViewCreated will no call. We can dynamic add the image view to frame layout on paused, and remove it on resumed.

Hey, I am also having the same issue. These workarounds don't work that great on multiple devices, so when it will be fixed by Flutter?

It's occurs on iOS too.

Getting this issue again in android

Here is a working solution that takes a screenshot of the UI and puts it behind the transparent Flutter UI to conceal the "missing frame" when resuming.
UPVOTE IF IT WORKS FOR YOU!
package smokeAndMirrors

import android.graphics.Bitmap
import android.graphics.Color
import android.os.Handler
import android.view.PixelCopy
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterSurfaceView
import io.flutter.embedding.android.TransparencyMode

class MainActivity : FlutterActivity() {
    // hook into pause to create a screenshot of the UI
    override fun onPause() {
        val uiScreenshot = this.uiScreenshot ?: return
        val uiSurfaceView = this.flutterSurfaceView ?: return

        screenshotToken++

        val uiBitmap = Bitmap.createBitmap(uiSurfaceView.width, uiSurfaceView.height, Bitmap.Config.ARGB_8888)
        uiScreenshot.setImageBitmap(uiBitmap)
        try {
            PixelCopy.request(
                    uiSurfaceView, uiBitmap, {},
                    Handler()
            )
        } catch (e: IllegalArgumentException) {
        }

        super.onPause()
    }

    // hook into resume to remove the screenshot (free up resources)
    override fun onResume() {
        super.onResume()

        val delay = 500L  // give a bit of time for the Flutter UI to render the first frame
        val screenshotToken = screenshotToken // don't increment token here!!!

        Handler().postDelayed({
            // ^ASYNC: still the same token?
            if (screenshotToken == this.screenshotToken) {
                uiScreenshot?.setImageDrawable(null)
            }
        }, delay)
    }

    // hook to place the container that contains the uiScreenshot layered below Flutter's UI view
    override fun setContentView(view: View) {
        uiScreenshot = ImageView(context)
        container = FrameLayout(this).also {
            it.setBackgroundColor(Color.WHITE)
            it.addView(uiScreenshot)
            it.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT))
            super.setContentView(it)
        }
    }

    // hook to remember the surface for taking screenshots
    override fun onFlutterSurfaceViewCreated(flutterSurfaceView: FlutterSurfaceView) {
        super.onFlutterSurfaceViewCreated(flutterSurfaceView)
        this.flutterSurfaceView = flutterSurfaceView
    }

    // make the Flutter UI transparent to see the screenshot behind it
    override fun getTransparencyMode(): TransparencyMode = TransparencyMode.transparent

    // this container will wrap the uiScreenshot + Flutter's UI view
    private var container: FrameLayout? = null

    // UI screenshot taken in onPause
    private var uiScreenshot: ImageView? = null

    // token to guard against async race conditions
    private var screenshotToken = 0

    // the surface that Flutter uses to draw the UI
    private var flutterSurfaceView: FlutterSurfaceView? = null
}

Could someone please explain how to implement this solution.

Verified this issue using latest versions and confirmed that the originally reported issue persists.
https://user-images.githubusercontent.com/67046386/224998226-8a286a29-28c9-407f-a177-5d81b2a41edd.mov
Code sample used: https://github.com/flutter/flutter/issues/59552#issuecomment-731033807 although this isn't specific to code sample. One can use any code, just need to push app to background or recent apps and then bring it forward.

 stable, master flutter doctor -v
[!] Flutter (Channel stable, 3.7.6, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.7.6 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 12cb4eb7a0 (8 days ago), 2023-03-01 10:29:26 -0800
    • Engine revision ada363ee93
    • Dart version 2.19.3
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.9.0-1.0.pre.183, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.9.0-1.0.pre.183 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 713842fb5b (2 hours ago), 2023-03-13 22:36:11 -0400
    • Engine revision 0fca429de5
    • Dart version 3.0.0 (build 3.0.0-322.0.dev)
    • DevTools version 2.22.2
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Similar issue: https://github.com/flutter/flutter/issues/34864
Everyone in this thread, if you are ok then we can follow-up on this behavior in the linked issue because that issue has more traction than this along with upvotes. Accordingly, I'll close this as duplicate.

i found simple solution, and It doesn't cause any other problems:
import androidx.annotation.NonNull import io.flutter.embedding.android.FlutterActivityLaunchConfigs import io.flutter.embedding.android.FlutterActivityLaunchConfigs.BackgroundMode import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() { override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine) }
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

this actually causes a splash screen problem. any solution for that?

up

The official app from Google: Play Console, written in flutter. Black screen after resumed. Native apps works fine.
https://github.com/flutter/flutter/assets/4150061/fb9e9f39-c6fb-423e-bff4-556c15a1270a

Experiencing the exact same thing on my app as @pamir72 has posted video of.

Here is a working solution that takes a screenshot of the UI and puts it behind the transparent Flutter UI to conceal the "missing frame" when resuming.
UPVOTE IF IT WORKS FOR YOU!
package smokeAndMirrors

import android.graphics.Bitmap
import android.graphics.Color
import android.os.Handler
import android.view.PixelCopy
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterSurfaceView
import io.flutter.embedding.android.TransparencyMode

class MainActivity : FlutterActivity() {
    // hook into pause to create a screenshot of the UI
    override fun onPause() {
        val uiScreenshot = this.uiScreenshot ?: return
        val uiSurfaceView = this.flutterSurfaceView ?: return

        screenshotToken++

        val uiBitmap = Bitmap.createBitmap(uiSurfaceView.width, uiSurfaceView.height, Bitmap.Config.ARGB_8888)
        uiScreenshot.setImageBitmap(uiBitmap)
        try {
            PixelCopy.request(
                    uiSurfaceView, uiBitmap, {},
                    Handler()
            )
        } catch (e: IllegalArgumentException) {
        }

        super.onPause()
    }

    // hook into resume to remove the screenshot (free up resources)
    override fun onResume() {
        super.onResume()

        val delay = 500L  // give a bit of time for the Flutter UI to render the first frame
        val screenshotToken = screenshotToken // don't increment token here!!!

        Handler().postDelayed({
            // ^ASYNC: still the same token?
            if (screenshotToken == this.screenshotToken) {
                uiScreenshot?.setImageDrawable(null)
            }
        }, delay)
    }

    // hook to place the container that contains the uiScreenshot layered below Flutter's UI view
    override fun setContentView(view: View) {
        uiScreenshot = ImageView(context)
        container = FrameLayout(this).also {
            it.setBackgroundColor(Color.WHITE)
            it.addView(uiScreenshot)
            it.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT))
            super.setContentView(it)
        }
    }

    // hook to remember the surface for taking screenshots
    override fun onFlutterSurfaceViewCreated(flutterSurfaceView: FlutterSurfaceView) {
        super.onFlutterSurfaceViewCreated(flutterSurfaceView)
        this.flutterSurfaceView = flutterSurfaceView
    }

    // make the Flutter UI transparent to see the screenshot behind it
    override fun getTransparencyMode(): TransparencyMode = TransparencyMode.transparent

    // this container will wrap the uiScreenshot + Flutter's UI view
    private var container: FrameLayout? = null

    // UI screenshot taken in onPause
    private var uiScreenshot: ImageView? = null

    // token to guard against async race conditions
    private var screenshotToken = 0

    // the surface that Flutter uses to draw the UI
    private var flutterSurfaceView: FlutterSurfaceView? = null
}

Is there a way to use this solution by extending FlutterFragmentActivity instead of FlutterActivity?

@JackieLovesProgramming exactly!
have you find any solution for that?

i found simple solution, and It doesn't cause any other problems:
import androidx.annotation.NonNull import io.flutter.embedding.android.FlutterActivityLaunchConfigs import io.flutter.embedding.android.FlutterActivityLaunchConfigs.BackgroundMode import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() { override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine) }
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
    return BackgroundMode.transparent
}

}

this actually causes a splash screen problem. screen flashes black ,not when on resume is called , anymore , but when splash screen has ended. any solution for that?

@Hossam-mustafa
unfortunately not...

The same happening to my app too on Android.
Sometimes it only flashes black on resume, but sometimes the screen remains black forever until I minimize it and resume it again.
This issue is very weird and might be annoying for the user

Removed P2 priority label to flag for re-triage.

I got rid of this by reducing the application load in the background (attempts to process network requests and more)

Here is a working solution that takes a screenshot of the UI and puts it behind the transparent Flutter UI to conceal the "missing frame" when resuming.
UPVOTE IF IT WORKS FOR YOU!
package smokeAndMirrors

import android.graphics.Bitmap
import android.graphics.Color
import android.os.Handler
import android.view.PixelCopy
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterSurfaceView
import io.flutter.embedding.android.TransparencyMode

class MainActivity : FlutterActivity() {
    // hook into pause to create a screenshot of the UI
    override fun onPause() {
        val uiScreenshot = this.uiScreenshot ?: return
        val uiSurfaceView = this.flutterSurfaceView ?: return

        screenshotToken++

        val uiBitmap = Bitmap.createBitmap(uiSurfaceView.width, uiSurfaceView.height, Bitmap.Config.ARGB_8888)
        uiScreenshot.setImageBitmap(uiBitmap)
        try {
            PixelCopy.request(
                    uiSurfaceView, uiBitmap, {},
                    Handler()
            )
        } catch (e: IllegalArgumentException) {
        }

        super.onPause()
    }

    // hook into resume to remove the screenshot (free up resources)
    override fun onResume() {
        super.onResume()

        val delay = 500L  // give a bit of time for the Flutter UI to render the first frame
        val screenshotToken = screenshotToken // don't increment token here!!!

        Handler().postDelayed({
            // ^ASYNC: still the same token?
            if (screenshotToken == this.screenshotToken) {
                uiScreenshot?.setImageDrawable(null)
            }
        }, delay)
    }

    // hook to place the container that contains the uiScreenshot layered below Flutter's UI view
    override fun setContentView(view: View) {
        uiScreenshot = ImageView(context)
        container = FrameLayout(this).also {
            it.setBackgroundColor(Color.WHITE)
            it.addView(uiScreenshot)
            it.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT))
            super.setContentView(it)
        }
    }

    // hook to remember the surface for taking screenshots
    override fun onFlutterSurfaceViewCreated(flutterSurfaceView: FlutterSurfaceView) {
        super.onFlutterSurfaceViewCreated(flutterSurfaceView)
        this.flutterSurfaceView = flutterSurfaceView
    }

    // make the Flutter UI transparent to see the screenshot behind it
    override fun getTransparencyMode(): TransparencyMode = TransparencyMode.transparent

    // this container will wrap the uiScreenshot + Flutter's UI view
    private var container: FrameLayout? = null

    // UI screenshot taken in onPause
    private var uiScreenshot: ImageView? = null

    // token to guard against async race conditions
    private var screenshotToken = 0

    // the surface that Flutter uses to draw the UI
    private var flutterSurfaceView: FlutterSurfaceView? = null
}

Is there a way to use this solution by extending FlutterFragmentActivity instead of FlutterActivity?

did u find any solution for FlutterFragmentActivity ?

Can anyone explain to me how to implement the workaround please?
I got some errors that MainActivity.ky was waiting for top level functions and imports should be at the beggining

From triage: Closing as duplicate of #34864


Bring back Video-Linking for MV3

In MV2, the extension supports finding the YouTube video for a Nebula video and vice-versa.

YouTube to Nebula: Transform all injectFunction* to bundled files and put into web_accessible_resources, the content policy disallows injecting arbitrary code
Nebula to YouTube: Use offscreen API instead of DOMParser (stashed implementation exists), figure out why sending a response from background script doesn't work

Is this expected to be solved soon or is there a way I can downgrade my version? This video linking is the whole reason I have this extension and I'd hate to lose it until a fix is eventually found if it's going to take a while

Depends on how much time I have.
If you are on firefox, everything works. Unfortunately, Chromium forces manifest V3 starting now, so not really, though I don't know what their policy is on manually installing MV2 (you can try to install the zip from the releases page, make sure to not take the v3 version).

This is now fixed and published, though it may take a while for Google to approve it, especially since this requires a new permission, please check for v1.5.2


fix: "Finding a value in an array" example in README

Resolves #118  and two other problems in the same example.

Thank you for finding and fixing the problems! LGTM.


What is the source of slight drift in the weights?

As you mentioned in readme, there is a slight drift in weights. I wonder what causes this drift. Thank you for your generous help in advance.

Unfortunetaly, I do not know where this imprecision comes from. In my experiments, I could transfer 2D convolutions perfectly but only with a slight drift when I used 3D convolutions.
If you discover the answer to this riddle, let me know !


Fedimint name not displayed in Dashboard

We noticed on the Follower dashboard, the name was not present.
Refreshing a dashboard on an already setup fedimint also does not display the federation name.

It looks like the AdminHeader component is using the SetupContext instead of the AdminContext. The former should not be available after setup, we should probably throw if any components try to use it outside of their respective parts of the app.

Blocked by https://github.com/fedimint/fedimint/issues/2451

Looks like @okjodom fixed this in #137: https://github.com/fedimint/ui/commit/2f8f87ec929b040b1e6d8a2095c532de18adde23


Consider Fractions of Seconds Properly in OData V4

Currently we assume three digits for the fractional seconds in the ODataV4 converte. However, this is not correct since the specification states: oasis->link to w3 times:
[0..5][digit].[S+]
So any number of digits after the two leading ones. We need to adjust the generator to:

Accept precision values when converting Edm.DateTimeOffset -> DateRepresentation in client (receiving data)
Deserialize the DateRepresentation -> Edm.DateTimeOffset (sending data)

The value for the percision is given on property level:
<Property Name="DraftEntityCreationDateTime" Type="Edm.DateTimeOffset" Precision="7"/>

The proper solution would be to parse the percision information and add it to the field in the generated client. This is a bigger change I guess. However, adjusting the Edm.DateTimeOffset -> DateRepresentation  to accept other percisions then 3 should be easy.
For the other direction we would need the information on the field to send the proper format.

Hi Frank,
the related OSS incident belongs to me and I created a custom deSerializer as a workaround. This logic is going to delete the nano seconds from the value of the ABAP Environment oData v4 endpoint, due to the fact, that javascript Date type isn't able to handle nano seconds anyway. So why saving it?
My approach:
import * as sdkOdataCommon from '@sap-cloud-sdk/odata-common/internal';
import moment from 'moment';

const dateTimeDeSerializer: sdkOdataCommon.DeSerializer<moment.Moment> = {
    deserialize: (val: string) => {
        // > in: 2022-06-09T12:55:16.530807Z
        const valWithoutNanoSeconds: string = val.slice(0, -4) + 'Z';
        // < out: 2022-06-09T12:55:16.530Z
        return moment(valWithoutNanoSeconds)},
    serialize: (val: moment.Moment) => val.toString()
};
export const customMomentDeSerializers = { 'Edm.DateTimeOffset': dateTimeDeSerializer };

Hope it does clarify it, adjusting the regex you're using as default should be fine from my POV.
Thanks and kind regards,
Cedric

Hello @drvup,
great that you found the custom DeSerializer as a mean to overcome the problem as a workaround. I was afraid, that the backend system would not accept a payload with an incorrect number of fractional seconds. Even if in JS they are not correctly handled. So if the EDMX specifies 4 digits and you POST a string like:
1989-01-01T14:23:59.123
it would reject it. I have not tried that to be honest, but this could depend on the system S/4, SFSF, Concour, Ariba.... I would like to have a solution where the number of digits is right.
Best
Frank

@florian-richter I also heard back from the OData expoert colleagues and the default precision would be 7.

@drvup: I implemented a fix to this issue in #2660 and it was published in v2.6.0 of the SAP Cloud SDK. Our default implementation will now behave similarly to your workaround and truncate the partial seconds (because moment and Date don't support any higher precision partial seconds). If you have time to try the new version, feel free to let us know if this allows you to remove your workaround.


What date range do the results cover?

Hello, thanks for the work. What date range do your study results cover?

2019

Hello, thanks for the work. What date range do your study results cover?

Hi there,
From 2015-08-08T05:20:23.000Z (The deployment datetime of the first contracts in the row) to 2023-11-28T09:40:59.000Z (The deployment datetime of the last contract).


Library broken with Angular v10: ModuleWithProviders<T> requires type argument

Reproduction link
https://github.com/angular/ngcc-validation/pull/1241
Steps to reproduce
With the project from ngcc-validation/projects/ng-zorro-antd-ngcc and the dependency versions shown in ngcc-validation/package.json (note we are mainly interested in the versions of @angular/*, ng-zorro-antd and TypeScript, run:
yarn install
yarn ng e2e ng-zorro-antd-ngcc

What is expected?
Building the app should succeed.
What is actually happening?
Building the app fails.

Environment
Info

ng-zorro-antd
9.1.2

Browser
Any

With PR https://github.com/angular/angular/pull/36963, the type argument was made mandatory for ModuleWithProviders. (This was documented as a breaking change in https://github.com/angular/angular/pull/37121.)
In certain cases, ngcc (the Angular Compatibility Compiler) is able to infer the type parameter, but not when used for an arbitrary type. component-bed.ts uses ModuleWithProviders without a type argument as part of the ComponentDeps type, which causes a build error when building against Angular v10.
To avoid the build error, you must pass a type argument to ModuleWithProviders (e.g. ModuleWithProviders<any> or ModuleWithProviders<unknown>).

For reference, we run into this issue on our ngcc-validation repo. Here is an example of a failing CI job: https://circleci.com/gh/angular/ngcc-validation/8853#tests/containers/3
ERROR in node_modules/ng-zorro-antd/core/testing/componet-bed.d.ts:4:54 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

4 declare type ComponentDeps = Array<Type<NzSafeAny> | ModuleWithProviders>;
                                                       ~~~~~~~~~~~~~~~~~~~

Hi @gkalpak
thanks a lot for your issue, we will fix it as soon as possible.


[BUG]: Notice PDF Issues

Describe the bug
Check the comments in the attached PDF.
1727683329141LNNhAaxDIF.pdf
Please adhere to template. @manimaarans (Unable to tag ajith). Please cross check the template for QA testing @rajeshcherukumalli
Template: https://docs.google.com/document/d/1WwJBOxotx6jwSaNT_iPgrQjiohLYdZoRDraZlZzwhgs/edit#heading=h.4emgxvs3m6c

@Ajith-beehyv @manimaarans please provide an update on this ticket as this is priority for tomorrow mornings demo

Its working fine for 'Notice to Accused' template, verified in QA[sol] env.
recent:///a3edfd6662a239d467a27b4d66feb388

Its working fine for 'Notice to Accused' template, verified in UAT env.
1728038485326KTDSWFjYGG.pdf


Enable RG tagging

Which issue this PR addresses:
Fixes ability to tag ONLY RG
What this PR does / why we need it:
This permission allows to tag Resource RP resources only as its scoped resource.
So we get ability to tag Resource Groups only. but nothing else for now.
Test plan for issue:
No
Is there any documentation that needs to be updated for this PR?
No

LGTM


[OTHER] <Test error for "event listed" test on the /events end point>

What would you like to share?
   Error: expect(received).toBeGreaterThan(expected)

    Matcher error: received value must be a number or bigint

    Received has type:  object
    Received has value: {"_frame": {"_guid": "frame@9ba2e5f7edd95b256e626fef153667cf", "_type": "Frame"}, "_selector": "li"}

      21 | test("Events listed", async ({ page }) => {
      22 |   await page.goto("/events");
    > 23 |   await expect(page.locator("li")).toBeGreaterThan(1);
         |                                    ^
      24 | });
      25 |
      26 | test.describe("accessibility tests (light)", () => {

        at /Users/jack/Documents/Dev/LinkFree/tests/events.spec.js:23:36

  1 failed
    [chromium] › events.spec.js:21:5 › Events listed

This error occurs because the "toBeGreaterThan" matcher expects a numeric or bigint value as the "received" parameter. However, the value passed to the expect function is an object with information about the located elements.
Additional information
No response

Good spot 👍 I think because no data has been loaded yet, so we should have the automated tests add some event data

The "events" directory within "tests/data/_test-profile-user-6" includes two example json files as shown in the below screenshot. I believe they are supposed to load when the test runs. Please correct me if my assumptions are wrong.

To fix the current issue, I propose that we modify our test expectation to properly check the count of the located elements using the .count() method provided by Playwright's Locator:
test("Events listed", async ({ page }) => {
  await page.goto("/events");
  const elements = await page.locator("li").count();
  await expect(elements).toBeGreaterThan(1);
});

Can I work on This?

Can I work on This?

@Pravesh-Sudha I have assigned this to you

@jackli921 I got a question , you mentioned in the above comment that we should use
test("Events listed", async ({ page })
but the source code include:
test.fixme("Events listed", async ({ page })
What should I use ?

@jackli921 I got a question , you mentioned in the above comment that we should use test("Events listed", async ({ page }) but the source code include: test.fixme("Events listed", async ({ page }) What should I use ?

Hi Pravesh, I removed the .fixme part so that the test can run. .fixme is included, the test will skip that one. If the changes you've made works, then you can submit a pull request without the .fixme I believe. You can always confirm it with one of the maintainers.

Thanks @jackli921 for the guidance, I have submitted the PR

Great collaboration 💪


Disable data augmentation

How could I do to train the model just with my dataset and not augmented data? I want to evaluate the difference between using or not data augmentation, does it make a significant difference?

If you don't want to use augmentation set the sollowing line:
data_gen_args = dict()
Significant difference, yes and no answer. IDepends on how varied your own data is...


Updating ImageStream comparison logic

Recently the release-controller has been struggling with images where
the .status.tag was ahead of the .spec.tag.  The logic in this PR
expected that these 2 values should be equal.  The fix is to error when
the .spec.tag is greater than the .status.tag.

/assign @smarterclayton

/lgtm
/approve


Extend config to allow setting custom icon and highlight

The PR extends the config and adds type annotations. With the update it will be possible to easily customize the sign via the config. It can also be a base for further extensions.
require("bookmarks").setup({
	sign = { icon = "" },
})

Hi Tt,
Thanks for making this PR, and I would love to add this function to the plugin.
I have some comments here, if you have some time can take a look, or I could do it later when I got some time~

I don't think we need make this name BookmarksNvimSign to be configurable.
Maybe makes the configuration more user understandable. Like:

{
  icon = "",
  icon_color = "red",
  line_font_color = "blue",
  line_bg_color = "red"
}

change the README accordingly

I don't think we need make this name BookmarksNvimSign to be configurable.
Good point about the BookmarksNvimSign, agreed .

Maybe makes the configuration more user understandable. Like:

{
  icon = "",
  icon_color = "red",
  line_font_color = "blue",
  line_bg_color = "red"
}

Personally, I would keep the config for the sign logically structured in a table instead of using a prefix. When extending the config it would could get unappealing quickly.
E.g., a feature I thought of is that it would be cool to be able to have multiple signs. E.g. when setting a mark without a note, and when annotating something with a mark.

I updated the PR be easily extensible for such potentials

change the README accordingly

Updated, the push includes an auto-formatting change. Let me know if this should be reverted


Initial chart for BAE APIs

This is the initial chart for the FIWARE Marketplace (Business Ecosystem) TMForum APIs

Not needed anymore, because a combined chart with all components has been created.


Update podpreset.md

Litle typo correction

Hi @CharlieBrownMx we'd love to review your PR but we haven't heard from you. So I'm going to temporarily close this PR, feel free to reopen when you're ready to continue 😄
/close


Decide on subteams within the group

Each member will choose to belong to at least one group mentioned below:

Front-end/ Web Team
Back-end Team
Mobile Team

Web Frontend Team (5 members)

@ozturkMirac
@EgemenKaplan
@sudek0
@alabeybahri
@orkunkilic

Mobile Team (4 members)

@MericKeskin
@FurkanOzcelik
@begumyivli
@celikomerfaruk

Backend Team (3 members)

@bakikucukcakiroglu
@bahadirgezer
@enesYildiz69

These roles are assigned to draw a team structure but some members can change their teams for practical purposes.

We thought that the responsibility of backend team is lighter than other teams so @enesYildiz69  voluntarily transferred to mobile team.
For latest version of sub-teams.

Web Frontend Team (5 members)

@ozturkMirac
@EgemenKaplan
@sudek0
@alabeybahri
@orkunkilic

Mobile Team (4 members)

@MericKeskin
@FurkanOzcelik
@begumyivli
@celikomerfaruk

Backend Team (3 members)

@bakikucukcakiroglu
@bahadirgezer
@enesYildiz69

These roles are assigned to draw a team structure but some members can change their teams for practical purposes.


chore: Update the build process to refer the Appsmith version from the info.json in all build artifacts

Fixes #29623
TBP run: https://github.com/appsmithorg/appsmith/actions/runs/7347634939

Summary by CodeRabbit

Chores

Enhanced version handling in client build process.
Improved Docker image version tagging in server build process.

/ok-to-test

/ok-to-test<EMAIL_ADDRESS>

Looks good. Can we also remove the REACT_APP_VERSION_* env variables and the versions:set command from the github-release.yml workflow as well? Or we can do that as a separate PR after we get confidence from this. Perfectly fine.

Oh man! We have this version extraction spread across lot of files, thanks Shri for taking the initiative and making sure to refer to single source going forward.
Let me take the changes related to github-release.yml in separate PR.

@abhvsn, sorry just realized, one other thing. Today, on server startup, we get a log line like this:
[2023-12-28 14:49:33,355]  - Starting ServerApplication vv1.9.57 using Java 17.0.9 with PID 1518 (/opt/appsmith/backend/server.jar started by root in /opt/appsmith/backend)

When users share logs with us, we use this line to figure out what version a log file belongs to. But I'm guessing Spring gets this version from the pom.properties file. Can we check if it's only printing v1.0-SNAPSHOT with the changes in this PR?
If yes, can we print the version and commitSha values from info.json on a line in the backend logs as well please?
I'm trying to see if we can set the version for Spring at runtime too, perhaps via a command line argument.

Doesn't look like. Spring is getting the version from the package's MANIFEST.MF file, and there doesn't seem to be a way to override that.

Let's log the version and commitSha in a line in the ServerApplication class ourselves instead.


Helm should fail if cert fails

A bad apikey for Venafi caused cert issuer to fail but Helm based deployment did not see this as a failure and deployed the app resulting in downtime.
An option to tell Helm to fail deployment if cert issuer fails.

@sgtobin could you explain how you create this issuer?
The cert-manager Helm chart does not include any runtime configuration (like issuers).
The Venafi issuer is normally created after the cert-manager Helm chart is installed, but we do not provide an official Helm chart for that.


How to check that output.bin file.

Hi,
I used this library in my app. I have one txt file in my app folder. How to use this library in app?
I am unable to find output.bin file in app?
Please help me.
Thanks,
Ekta

You have to create the bin file prior to using it in an app.
You can create a bin file using this line of code in a project.
// Create a dawg binary file from a word list file.
assert(DawgBuilder.build(readingFrom: "~/input.txt", writingTo: "~/output.bin"))

Once that completes you should have a bin file in your home directory.
You can then load the bin file using:
let dawg = Dawg.load(from: "~/output.bin")
assert(dawg != nil)

This should only be done once ideally, as it's not a quick process, so you should create a singleton or inject it where you need to use the object.
In order to see if words exist you use the 'lookup' method.
// Returns false if the word is undefined
assert(dawg.lookup("plane"))

Please let me know if you need more information.

Hi Chris,
Thanks for your feedback.
Can you please tell me that how to open command line tool from xcode?

Can I use this library in single view application?

File -> New Project -> macOS -> Command Line Tool
Paste the line above.
Put your file in ~ and call it 'input.txt'
Press ⌘R
Wait until it completes.

Once you've compiled the .bin file you can use it wherever you like. It should just be compiled separately to a production app as it takes quite a while to process.

It gives me "assertion failed".
I have added "file.txt".

assert(DawgBuilder.build(readingFrom: "~/file.txt", writingTo: "~/output.bin"))

That is the incorrect path if you're going to bundle the file you'd need to find it using NSBundle.
Just paste the input file in ~ directory and use the example provided it's easier.

Means I need to create one directory named "~".

On a mac/unix system ~ refers to the home directory.

Okay Now I got. Sorry. :(

Can I close this issue?

No. Please help me. I have added that file in root dir but still error.

You pasted it in ~ and called it input.txt
Then you loaded the file in the app by calling ~/input.txt?

Yes. in main.swift file
import Foundation
print("Hello, World!")
// Create a dawg binary file from a word list file.
assert(DawgBuilder.build(readingFrom: "~/input.txt", writingTo: "~/output.bin"))

Check this.

What format is your input.txt file?
It should contain each word on a new line

If the build command fails it's because the file is not readable.
Can you paste this above the 'build' method:
do {
let data = try String(contentsOfFile: "~/input.txt", encoding: String.Encoding.utf8)
} catch err {
print(err)
}

Then paste what you get?
Cheers


OAK-9459: ConstraintViolationException in VersionManagerImplRestore w…

…hen target node has a property definition unknown by the frozen node
Fixed by retrieving the property definitions before setting the node types.

Replaced by https://github.com/apache/jackrabbit-oak/pull/1183


fix: Enable Kebab menu in the topic page consumer group

What this PR does / why we need it:

[x] Enable the Kebab menu in the topic page consumer group
[x] fixed the state column to display the value in the consumer group table

Which issue(s) this PR fixes
https://issues.redhat.com/browse/MGDSTRM-7854
output
Enable the Kebab menu in the topic page consumer group

There are some changes in the values that are defined inside the kebab menu that are already addressed in storybook


An application object of type with ID is already declared when package solution

Hi All,
I having issue when package my solution no issue but Visual Studio Code show the error.
Anyone know why ? I am using version 14. Runtime 3.0. Based on the article install .NET Framework 4.7.2 but still error.

I suggest to uninstall and unpublish all your extensions and try again or try to publish the extension to a clean DB, The same extension might be installed with a different name. If it didn't help you to solve the issue, it would be helpful to send us a package that clearly reproes the issue.
/Pooya

Same problem I have. #4943

I am facing same error, if its an error.

Guys.
For now its better to use .vsix from spring release.

Hi @Tonygithub17
You probably have a dependency on another extension that also declare a table with the same Id.
If you comment out your table and in another object declare a variable:
Foo : record 70000
and you right click on the 70000 and pick Go-To Definition then you should be able to see the other table, whom your table is colliding with.

Closing this issue as it was inactive for the last month. If you are still facing this problem, please a log a new issue and attach some AL packages that we could use to reproduce and investigate the issue.

I have got the same problem today.
AL Language v8.2.545335.
That's obviously not a problem of the compiler, the app can be compiled and published without an error.
Solution (worked for me):

disable Visual Studio Code extension "AL Language".
enable Visual Studio Code extension "AL Language".
wait till it loads and parses the source code.

@thpeder Thank you for this.  This was the first thing I should have tried.  Turns out there were two pages that were causing a symbol reference in 'Codeunit 0'.  Removing these two pages from the project was the resolution to my issue.


add option to increase max file size supported by body-parser

Middleware error
PayloadTooLargeError: request entity too large at readStream
The transferred entity is 42Mb, so how could I increase amount of transferred data via lws  config?
Error message:
Middleware error PayloadTooLargeError: request entity too large     at readStream (/usr/local/lib/node_modules/local-web-server/node_modules/raw-body/index.js:155:17)     at executor (/usr/local/lib/node_modules/local-web-server/node_modules/raw-body/index.js:112:5)     at new Promise (<anonymous>)     at getRawBody (/usr/local/lib/node_modules/local-web-server/node_modules/raw-body/index.js:111:10)     at /usr/local/lib/node_modules/local-web-server/node_modules/co-body/lib/json.js:41:14     at process._tickCallback (internal/process/next_tick.js:68:7)

Try omitting lws-body-parser from the stack..
if you run this command you'll see the default middleware stack (the list of middleware plugins that are active by default):
$ ws --default-stack
[
  'lws-basic-auth',
  'lws-body-parser',
  'lws-request-monitor',
  'lws-log',
  'lws-cors',
  'lws-json',
  'lws-compress',
  'lws-rewrite',
  'lws-blacklist',
  'lws-conditional-get',
  'lws-mime',
  'lws-range',
  'lws-spa',
  'lws-static',
  'lws-index'
]

To omit lws-body-parser (which i suspect is causing the issue) from the middleware stack, run this command (i skipped the lws- prefix from each plugin name - it is optional):
$ ws --stack basic-auth request-monitor log cors json compress rewrite blacklist conditional-get mime range spa static index

Let me know if that fixes the issue.

@75lb your approach helped me, many thanks! It should be mentioned that prior to run your code, I grabbed the latest version of lws.

OK, I'm glad we isolated the issue. However, I still need to fix lws-body-parser.
I'll look into adding a new option which increases the maximum size of files supported by body-parser. Let me know if you find any other issues! 👍

@75lb option for increasing size will be great!
P.S. It will be good to have an exclude flag for stack middleware also.

Excluding flag is a great idea. And a option for increasing the limit would be nice, either.
Still needing help on this?

yes, both features are required - I will write some instructions later.. In the meantime, feel free to try some ideas!

Fixed and released in local-web-server v5.4.0


Webviewer error when performing certain actions after newly created redaction

After reating a new redaction,  when we perform certain actions without refreshing, the webviewer will throw an error.
There is no noticable functional impact, however we should still try to solve this issue. I have tried to reproduce this error using a simpler sample code from pdftron but so far have been unable to do so. So we need more investigation on this bug
Impact of this bug
Low - medium: no noticable impact so far, but could cause other errors if user stays on page
Chance of Occurring (high/medium/low/very low)
high - happens every time
Pre Conditions: which Env, any pre-requesites or assumptions to execute steps?
Steps to Reproduce
Steps to reproduce the behavior:

create a new redaction
do not refresh
either change layer or save final package
check console for error

The error is coming from some property in their code being set to null. I have added screenshots below. In the case of change layer, the call is ultimately coming from deleteAnnotations. When saving final package, it is due to applyRedactions
Private Zenhub Image
Private Zenhub Image
Private Zenhub Image
Private Zenhub Image

webviewer error is not showing up after creating a redaction and then changing the layer. So closing it