Open SnowZero opened 1 year ago
I can reproduce this issue only on API 32. Seems to work correctly on API 33. Closing the device works for me while reopening it, crashes. Tested on the same emulator as OP mentioned above i.e. 7.6 Fold-in with outer display API 32
I have similar Firebase Crashlytics happening on product project, I suspect the same problem
Android 12 Xiaomi MIX Fold
@SnowZero Just you need is to open the build.gradle, the path for this file is: android/app/build.gradle. After that have been opened the file, put this command at dependencies
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
I found the solution on stack overflow, see at: https://stackoverflow.com/questions/74163927/flutter-chrash-in-android-12l-with-no-interface-method-addwindowlayoutinfoliste
@SnowZero did the workaround mentioned by @PhRezende-eng work for you, or if not are you still able to reproduce this issue with the latest version of Flutter?
This issue still exists in Flutter 3.13.1
@mariamhas Was this a reported issue for the Wonderous app as well when getting large screen Tier 2 certified?
I was not able to reproduce this with Wonderous Android app running on an actual foldable phone, I suspect this may only happen in the emulator.
Still reproducible in 3.22.1. More details from ADB in https://github.com/flutter/flutter/issues/149115
Process: com.example.list_detail, PID: 5225
java.lang.IllegalArgumentException: Bounding rectangle must start at the top or left window edge for folding features
at androidx.window.extensions.layout.FoldingFeature.validateFeatureBounds(FoldingFeature.java:128)
at androidx.window.extensions.layout.FoldingFeature.<init>(FoldingFeature.java:95)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.getDisplayFeatures(WindowLayoutComponentImpl.java:341)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.getDisplayFeatures(WindowLayoutComponentImpl.java:316)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.getWindowLayoutInfo(WindowLayoutComponentImpl.java:265)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.onDisplayFeaturesChanged(WindowLayoutComponentImpl.java:250)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.$r8$lambda$CcdqSJgN0v7j8yjFplaR5_gC_ag(Unknown Source:0)
at androidx.window.extensions.layout.WindowLayoutComponentImpl$$ExternalSyntheticLambda0.accept(Unknown Source:4)
at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.runCallbackWhenValidState(DeviceStateManagerFoldingFeatureProducer.java:148)
at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.lambda$getData$0(DeviceStateManagerFoldingFeatureProducer.java:200)
at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.$r8$lambda$aShjSiJsnArI0ZW6HG-0QPWddJk(Unknown Source:0)
at androidx.window.common.DeviceStateManagerFoldingFeatureProducer$$ExternalSyntheticLambda2.accept(Unknown Source:6)
at androidx.window.common.RawFoldingFeatureProducer.getData(RawFoldingFeatureProducer.java:71)
at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.getData(DeviceStateManagerFoldingFeatureProducer.java:196)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.onDisplayFeaturesChangedIfListening(WindowLayoutComponentImpl.java:397)
at androidx.window.extensions.layout.WindowLayoutComponentImpl.-$$Nest$monDisplayFeaturesChangedIfListening(Unknown Source:0)
at androidx.window.extensions.layout.WindowLayoutComponentImpl$NotifyOnConfigurationChanged.onActivityConfigurationChanged(WindowLayoutComponentImpl.java:415)
at android.app.Application.dispatchActivityConfigurationChanged(Application.java:576)
at android.app.Activity.dispatchActivityConfigurationChanged(Activity.java:1631)
at android.app.Activity.onConfigurationChanged(Activity.java:3180)
at android.app.ActivityThread.performActivityConfigurationChanged(ActivityThread.java:6096)
at android.app.ActivityThread.performConfigurationChangedForActivity(ActivityThread.java:6021)
at android.app.ActivityThread.handleActivityConfigurationChanged(ActivityThread.java:6366)
at android.app.ActivityThread.handleActivityConfigurationChanged(ActivityThread.java:6304)
at android.app.servertransaction.ActivityConfigurationChangeItem.execute(ActivityConfigurationChangeItem.java:55)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
This seems to be an issue on native side with androidx.window:window-java
: https://issuetracker.google.com/issues/262411062?pli=1 (it's fixed, see https://issuetracker.google.com/issues/262411062#comment9)
Steps to Reproduce
7.6 Fold-in with outer display API 32
Demo
flutter doctor
``` [✓] Flutter (Channel stable, 3.3.7, on macOS 12.5 21G72 darwin-arm (Rosetta), locale zh-Hant-TW) [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.71.1) [✓] Connected device (7 available) [✓] HTTP Host Availability ```