【发布时间】:2021-05-28 05:36:12
【问题描述】:
所有更新信息都在这里:Flutter Project : Errors (mostly with Android Manifest and Main Activity files)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="polacoenchile.world_time_app2">
<application
android:label="world_time_app2"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
这就是我的文件的样子,我从来没有碰过任何东西,所以我不知道出了什么问题。在图片上我显示所有错误。我进行分析是因为在模拟器上一切正常。我制作了 .apk 文件以安装在我的手机上,我成功了,但 applicacion 没有显示任何内容,只是灰色背景。 有谁知道怎么回事?
MainActivity 文件
package polacoenchile.world_time_app2
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
FLutter 医生在将 Flutter 降级到稳定版本后发现了一些问题。但我确信我会在我的 android studio 中添加插件:Flutter、Dart
C:\Users\wdowk>flutter doctor -v
[√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.18363.1379], locale pl-PL)
• Flutter version 1.22.6 at C:\src\flutter
• Framework revision 9b2d32b605 (5 weeks ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\wdowk\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: F:\Program Files\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 F:\Program Files\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)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
【问题讨论】:
-
您正在使用 android studio 从颤振项目中打开 xml 文件?打开“android”文件夹作为一个单独的项目(文件->打开->flutterproject/android)并检查你的android项目构建时是否看到任何这些错误。
-
好的,我会尝试,一会儿,我更新了我的问题,我改变了照片,因为我修复了一些。我是颤振的新手,所以我不知道如何检查它。我只是看到安装后我的应用程序不起作用,我只看到我说的灰色背景,仅此而已。所以,我会试着像你说的那样做,我希望我不知道如何让它变得更好。
-
好的,我做到了,我在上面的问题上放了一个屏幕^^图片2和3。这就是现在的样子