Code Monkey home page Code Monkey logo

Comments (6)

Vadaski avatar Vadaski commented on May 12, 2024

这个是 Flutter 运行时产物,可以先在项目根目录用 flutter clean 清除,再用 flutter create . 或者直接运行 flutter run 跑一次就可以了

from flutter-notebook.

ViShadowFiend avatar ViShadowFiend commented on May 12, 2024

你好, 我试了 flutter clean 再 flutter run, 但是不行. AndroidManifest.xml 是 android 项目必须的文件, 它应该不是 flutter 运行时产物

from flutter-notebook.

Vadaski avatar Vadaski commented on May 12, 2024

我刚试了一下,提示说的比较清楚了:在项目目录下运行 flutter create .

from flutter-notebook.

ViShadowFiend avatar ViShadowFiend commented on May 12, 2024

非常感谢, 原来之前我忽略了 create 后面的 .


不过现在虽然自动创建了 AndroidManifest 文件, 不过却运行不起来, 报错如下:

D:\Code\github\flutter\Flutter-Notebook-master\mecury_project\example\animated_floating_action_bar\android\app\src\main\java\com\litavadaski\animatedfloatingactionbar\MainActivity.java:11: ����: �����ݵ�����: MainActivity�޷�ת��ΪFlutterEngine
    GeneratedPluginRegistrant.registerWith(this);
                                           ^
ע: ijЩ��Ϣ�Ѿ�����; ��ʹ�� -Xdiags:verbose ���±����Ի���������
1 ������

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Finished with error: Gradle task assembleDebug failed with exit code 1

使用 --stacktrace 查看错误如下

D:\Code\github\flutter\Flutter-Notebook-master\mecury_project\example\animated_floating_action_bar\android\app\src\main\java\com\litavadaski\animatedfloatingactionbar\MainActivity.java:11: 错误: 不
兼容的类型: MainActivity无法转换为FlutterEngine
    GeneratedPluginRegistrant.registerWith(this);

我跟正常运行的项目中的 MainActivity 比对了一下, 发现代码是一模一样的, 这是哪里不对呢?烦请作者帮忙看下

from flutter-notebook.

moqiang02 avatar moqiang02 commented on May 12, 2024

MainActivity改成这样既可:

package com.litavadaski.provider_example;

import android.os.Bundle;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
//    GeneratedPluginRegistrant.registerWith(this);
  }

  @Override
  public void configureFlutterEngine(FlutterEngine flutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine);
  }
}

from flutter-notebook.

ViShadowFiend avatar ViShadowFiend commented on May 12, 2024

非常感谢!

from flutter-notebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.