I'm making an app with flutter for Android. It works fine on the emulator, but on Android devices it freezes on white or black screen. When the dark theme is ON, it turns black, and when it is OFF, it turns white.
flutter doctor -v
[√] Flutter (Channel beta, 2.6.0-5.2.pre, on Microsoft Windows [Version 10.0.22000.258], locale ja-JP)
• Flutter version 2.6.0-5.2.pre at D:\src\flutter_windows_2.5.0-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 400608f101 (6 weeks ago), 2021-09-15 15:50:26 -0700
• Engine revision 1d521d89d8
• Dart version 2.15.0 (build 2.15.0-82.2.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at D:\Android
• Platform android-30, build-tools 29.0.3
• Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.2)
• Android Studio at D:\Program Files\Android\Android Studio
• 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 11.0.8+10-b944.6842174)
[√] VS Code (version 1.61.2)
• VS Code at C:\Users\yukik\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.27.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.54
• Edge (web) • edge • web-javascript • Microsoft Edge 95.0.1020.30
• No issues found!
Run command
Get ID of device
$ flutter devices
Then run with
$ flutter run -d <ID>
or
$ flutter run --verbose -d <ID>
Console
Launching lib\main.dart on Pixel 5a in debug mode... Running Gradle task 'assembleDebug'... 37.6s √ Built build\app\outputs\flutter-apk\app-debug.apk. W/DynamiteModule(12590): Local module descriptor class for providerinstaller not found. I/DynamiteModule(12590): Considering local module providerinstaller:0 and remote module providerinstaller:0 W/ProviderInstaller(12590): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0. I/avapp.exampl(12590): The ClassLoaderContext is a special shared library. I/avapp.exampl(12590): The ClassLoaderContext is a special shared library. V/NativeCrypto(12590): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 294 native methods... W/avapp.exampl(12590): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (greylist, reflection, allowed) I/ProviderInstaller(12590): Installed default security provider GmsCore_OpenSSL Syncing files to device Pixel 5a... 119ms
Flutter run key commands. r Hot reload. R Hot restart. h List all available interactive commands. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device).
Running with sound null safety
An Observatory debugger and profiler on Pixel 5a is available at: http://127.0.0.1:51161/i6VNWPsZf28=/ W/avapp.exampl(12590): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (greylist, reflection, allowed) W/avapp.exampl(12590): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, linking, allowed) W/avapp.exampl(12590): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, linking, allowed) W/avapp.exampl(12590): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (greylist, reflection, allowed) W/avapp.exampl(12590): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (greylist,core-platform-api, linking, allowed) W/avapp.exampl(12590): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (greylist, linking, allowed) W/Firestore(12590): (23.0.4) [Firestore]: Listen for Query(target=Query(genres order by name);limitType=LIMIT_TO_FIRST) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null} E/flutter (12590): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation. E/flutter (12590): #0
MethodChannelQuery.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_query.dart:110:7) E/flutter (12590): E/flutter (12590): #1
_JsonQuery.get (package:cloud_firestore/src/query.dart:390:9) E/flutter (12590): E/flutter (12590): #2
main (package:example/main.dart:25:3) E/flutter (12590): E/flutter (12590): The Flutter DevTools debugger and profiler on Pixel 5a is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:51161/i6VNWPsZf28=/ I/avapp.exampl(12590): WaitForGcToComplete blocked RunEmptyCheckpoint on ProfileSaver for 15.090ms