【发布时间】:2022-01-02 00:55:51
【问题描述】:
我的 APK 文件只显示灰屏,但在调试模式下运行良好。
Flutter Doctor(编辑):
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 10.0.19043.1415], locale ko-KR)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)
[√] Connected device (3 available)
• No issues found!
main.dart:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await Hive.initFlutter();
await Hive.openBox("myBox1");
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]
).then((_) => runApp(const MyApp()));
}
AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
是什么导致了这个问题?
【问题讨论】:
-
我完成了设置,但没有任何改变。
标签: android flutter apk bundle