-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Description
I have an app that builds, launches, and executes as expected on multiple laptops in multiple emulators and also on physical device (Galaxy S7 in debug mode). However, any RELEASE build will install and launche fine on physical devices but first AWAIT call hangs the app. This was duplicated on same devices where debug was completely successful. Tested devices (Galaxy S7 and Samsung Tab A). Emulators used for testing have the same v8 android OS matching that of the Galaxy S7.
Debug testing was performed on 2 separate laptops independly installed with VSCode (dart and flutter plugins are up-to-date).
NOTE: Debug testing is completely successful on the S7 and Samsung Tab A devices for this app. It is just the RELEASE build that seems to fail in all devices.
To Reproduce:
-
Build the release using one of the following:
flutter build apk --release
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
I tested the FAT apk as well as the version specific to the device. Same result. -
Launch the application and you will see a splash view. Click the Play button and it will hang on line 1047 of file lib>widgets>app_wg.dart. But the hang is not specific to this command from what I can tell because I have replaced it with other async calls using await and it hangs for any of them.
This was reported on StackOverflow with several views but no responses.
https://stackoverflow.com/questions/65824019/flutter-app-release-build-hangs-on-call-to-getapplicationdocumentsdirectory
Expected Result - Launch of the app and hit Play on the splash screen and you should be prompted for permissions if the app does not have external storage permissions. If it does have permissions you will be directed to the apps home screen.
Actual result - async call on app_wg.dart line 1047 hangs the app.
Flutter bug output
logs
PS C:\Dev\Projects\Flutter\quifil> flutter create bug
Creating project bug...
bug\.gitignore (created)
bug\.idea\libraries\Dart_SDK.xml (created)
bug\.idea\libraries\KotlinJavaRuntime.xml (created)
bug\.idea\modules.xml (created)
bug\.idea\runConfigurations\main_dart.xml (created)
bug\.idea\workspace.xml (created)
bug\.metadata (created)
bug\android\app\build.gradle (created)
bug\android\app\src\main\kotlin\com\example\bug\MainActivity.kt (created)
bug\android\build.gradle (created)
bug\android\bug_android.iml (created)
bug\android\.gitignore (created)
bug\android\app\src\debug\AndroidManifest.xml (created)
bug\android\app\src\main\AndroidManifest.xml (created)
bug\android\app\src\main\res\drawable\launch_background.xml (created)
bug\android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created)
bug\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
bug\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created)
bug\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created)
bug\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created)
bug\android\app\src\main\res\values\styles.xml (created)
bug\android\app\src\profile\AndroidManifest.xml (created)
bug\android\gradle\wrapper\gradle-wrapper.properties (created)
bug\android\gradle.properties (created)
bug\android\settings.gradle (created)
bug\ios\Runner\AppDelegate.swift (created)
bug\ios\Runner\Runner-Bridging-Header.h (created)
bug\ios\Runner.xcodeproj\project.pbxproj (created)
bug\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (created)
bug\ios\.gitignore (created)
bug\ios\Flutter\AppFrameworkInfo.plist (created)
bug\ios\Flutter\Debug.xcconfig (created)
bug\ios\Flutter\Release.xcconfig (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-1024x1024@1x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@1x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@2x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@3x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@1x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@2x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@3x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@1x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@2x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@3x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@2x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@3x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@1x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@2x.png (created)
bug\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-83.5x83.5@2x.png (created)
bug\ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (created)
bug\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (created)
bug\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@2x.png (created)
bug\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@3x.png (created)
bug\ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (created)
bug\ios\Runner\Base.lproj\LaunchScreen.storyboard (created)
bug\ios\Runner\Base.lproj\Main.storyboard (created)
bug\ios\Runner\Info.plist (created)
bug\ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (created)
bug\ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (created)
bug\ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (created)
bug\ios\Runner.xcworkspace\contents.xcworkspacedata (created)
bug\ios\Runner.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (created)
bug\ios\Runner.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (created)
bug\lib\main.dart (created)
bug\bug.iml (created)
bug\pubspec.yaml (created)
bug\README.md (created)
bug\test\widget_test.dart (created)
Running "flutter pub get" in bug... 5.0s
Wrote 71 files.
All done!
flutter doctor -v
[√] Flutter: is fully installed. (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.18363.1316], locale en-US)
[√] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.2)
[!] Android Studio: is partially installed; more components are available. (version 4.1.0)
[√] VS Code: is fully installed. (version 1.52.1)
[!] Connected device: is not available.
**PS C:\Dev\Projects\Flutter\quifil> flutter doctor -v**
[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.18363.1316], locale en-US)
• Flutter version 1.22.5 at C:\Flutter\SDK
• Framework revision 7891006299 (6 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\robsh\AppData\Local\Android\Sdk
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = C:\Users\robsh\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[!] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.52.1)
• VS Code at C:\Users\robsh\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.18.1
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
PS C:\Dev\Projects\Flutter\quifil>
Example RELEASE build
app-release.zip
VSCode full project file (minus the builds since that greatly increased the zip file size)
quifil.vscode_project.zip
Pics of S7 Galaxy Specs
Specs | Specs | Specs |
---|---|---|
![]() |
![]() |
![]() |