简体   繁体   English

Flutter 项目:错误

[英]Flutter Project: Errors

All updated information here: Flutter Project: Errors (mostly with Android Manifest and Main Activity files)此处所有更新信息: Flutter 项目:错误(主要与 Android 清单和主要活动文件有关)

<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>

This is how look my file, I never touch there nothing so I have no idea what is wrong.这就是我的文件的外观,我从来没有碰过任何东西,所以我不知道出了什么问题。 On the picture i am showing all errors.在图片上我显示所有错误。 I make analyze because on emulator all is working good.我进行分析是因为在模拟器上一切正常。 I made.apk file to install on my phone, i made it but applicacion is not showing nothng, just grey background.我制作了.apk 文件以安装在我的手机上,我成功了,但应用程序没有显示任何内容,只是灰色背景。 Anyone know what is wrong?有谁知道出了什么问题?

my app project errors我的应用项目错误

android project android项目

android project errors android 项目错误

mainactivity file主要活动文件

MainActivity file主活动文件

package polacoenchile.world_time_app2

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

FLutter doctor found few problems after downgrade flutter to stable version. FLutter 医生在将 flutter 降级到稳定版本后发现了一些问题。 But i am sure i add plugins to my android studio: Flutter, Dart但我确定我将插件添加到我的 android 工作室: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.

You Commented on the part where you shouldn't commented out, If you fix this line all will be working你评论了你不应该评论的部分,如果你修复这条线,一切都会工作

   <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM