相关文章推荐
冲动的弓箭  ·  解决报错 ...·  6 天前    · 
追风的炒粉  ·  portError: ...·  2 天前    · 
痴情的甘蔗  ·  optimistic locking ...·  2 月前    · 
着急的大象  ·  android profiler ...·  1 年前    · 
果断的凉茶  ·  表的类型 | MicrosoftDocs ...·  1 年前    · 
瘦瘦的猴子  ·  error with msodbc ...·  1 年前    · 

在Android原生项目新建了flutter module,然后引入其他Flutter Project项目的lib下的dart文件和项目的pubspec.yaml文件,

运行main.dart报错:

Launching lib/main.dart on sdk gphone x86 arm in debug mode...
AndroidManifest.xml could not be found.
Please check /home/liucz/StudioProjects/coming_androidv4_66_1/coming-android/polkawallet/android/AndroidManifest.xml for errors.
No application found for TargetPlatform.android_x86.
Is your project missing an android/AndroidManifest.xml?
Consider running "flutter create ." to create one.

在Android项目的对应flutter module下执行flutter create .

$ flutter create .
Recreating project ....
Warning: You are using these overridden dependencies:                   
! polkawallet_ui 0.1.4 from git https://github.com/polkawallet-io/ui.git at e81dc9
Running "flutter pub get" in polkawallet...                        760ms
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Wrote 0 files.
All done!
Your module code is in lib/main.dart.

查看flutter module的目录:
在这里插入图片描述
如图中选中的所示,polkawallet目录下新生成了androidios两个目录,之前是没有的,注意这是androidios,不是.android.ios.android.ios是之前就有的。

点击运行按钮:

Launching lib/main.dart on sdk gphone x86 arm in debug mode...
AndroidManifest.xml could not be found.
Please check /home/liucz/StudioProjects/coming_androidv4_66_1/coming-android/polkawallet/android/AndroidManifest.xml for errors.
No application found for TargetPlatform.android_x86.
Is your project missing an android/AndroidManifest.xml?
Consider running "flutter create ." to create one.

于是,拷贝了一份.android/app/src/main目录下的AndroidManifest.xml 文件到报错提示的android目录下,然后运行,还是报错:

Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Exception: [!] The build process for Android has changed, and the current project configuration is no longer valid. Please consult
https://github.com/flutter/flutter/wiki/Upgrading-Flutter-projects-to-build-with-gradle
for details on how to upgrade the project.

https://github.com/flutter/flutter/wiki/Upgrading-Flutter-projects-to-build-with-gradle

解决:
不要把其他Flutter Project项目的lib下的dart文件和项目的pubspec.yaml都拷贝到Android原生项目的flutter module中,可以保持Android原生项目的flutter module的pubspec.yaml文件不变,然后只需要去Flutter Project项目的pubspec.yaml中复制dependenciesdependency_overrides标签下的相关所需的依赖过来即可。

总结:
在Android原生项目新建flutter module,然后引入其他Flutter Project项目时不能把lib下的dart文件和项目的pubspec.yaml都拷贝到Android原生项目的flutter module中,因为Flutter Project是全Flutter的环境,里面的依赖包也是假设在全Flutter的环境下运行的。

更多可参考:flutter:The plugin flutter_aes_ecb_pkcs5 is built using an older version of the Android plugin API

相关:
AndroidManifest.xml could not be found

Flutter报错: Is your project missing an ios/Runner/Info.plist 或 Is your project missing an android/And

Launching lib/main.dart on sdk gphone x86 arm in debug mode...AndroidManifest.xml could not be found.Please check /home/liucz/StudioProjects/coming_androidv4_66_1/coming-android/polkawallet/android/AndroidManifest.xml for errors.No application found for
简单的程序包,可利用InheritedWidget的功能简化Flutter使用。 class SomeRootWidget extends StatelessWidget { @override Widget build ( BuildContext context) { return InjectorWidget . bind ( bindFunc : (binder) { binder .. install ( MyModule ()) .. bindSingleton ( "api123" , name : "api_key" ); child : SomeWidget () 您还可以扩展BindingInjectorWidget来配置依
sqlite3.dart 该项目包含Dart包,可通过dart:ffi使用DartSQLite。 该存储库中的主要软件包是 ,其中包含所有Dart api及其实现。 package:sqlite3是不依赖Flutter的纯Dart程序包。 In既可以在Flutter应用程序中使用,也可以在独立的Dart应用程序中使用。 sqlite3_flutter_libs和sqlcipher_flutter_libs软件包根本不包含Dart代码。 Flutter用户可以依靠其中之一在其应用程序中包含本机库。 可以在找到带有纯Dart基本用法示例的文件。
model_viewer : ^0.8.1 AndroidManifest.xml (仅适用于Android 9+) 要在Android 9+设备上使用此小部件,必须允许您的应用与http://localhost:XXXXX建立HTTP连接。 Android 9(API级别28)将的默认设置从true更改为false ,因此您需要按以下方式配置应用程序的android/app/src/main/AndroidManifest.xml : --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,8 @@ YourFlutterapplicationiscreatedusinganolderversionoftheAndroid embedding.It'sbeingdeprecatedinfavorofAndroidembeddingv2. 解决办法:打开androi... github 新 down 下来的项目执行 flutter package get 时报错 Your Flutter application is created using an older version of the Android embedding. It’s being deprecated in favor of Android embedding v2. 将下方标签添加至 AndroidManifest.xml 文件的 activity 标签下 <meta-data
1.Flutter报错: Is your project missing an ios/Runner/Info.plist 或 Is your project missing an android/And 报错信息: 运行在ios上报错 No application found for TargetPlatform.ios. Is your project missing an ios/Runner/Info.plist? Consider running "flutter create ." to
Failed to extract manifest from APK: ProcessException: %1 不是有效的 Win32 应用程序。 Is your project missing an android\app\src\main\AndroidManifest.xml? Launching lib\main.dart on ** in debug mode… Failed to extract manifest from APK: ProcessException: %1 不是有效的 Wi
1.VM snapshot invalid and could not be inferred from settings/Could not setup VM data to bootstrap the VM from. 2.couldn't find "libflutter.so" 3.ERROR: Java 8 language support, as requested by ...
Couldn't resolve the package 'flutter_base' in 'package:flutter_base/flutter_layout_page.dart'.
这个报错可能是因为你在 `flutter_layout_page.dart` 中导入了 `flutter_base` 包,但是该包并没有被正确地引入。你可以按照以下步骤进行处理: 1. 确认你的项目中是否有 `flutter_base` 包。你可以在 `pubspec.yaml` 中查看是否有类似以下代码: dependencies: flutter_base: ^1.0.0 2. 如果你的项目中没有 `flutter_base` 包,你需要在 `pubspec.yaml` 文件中添加依赖,然后运行 `flutter packages get` 命令下载包。 3. 如果你已经添加了依赖,但是仍然出现了该错误,请尝试运行 `flutter packages upgrade` 命令更新依赖包。 4. 确认你在 `flutter_layout_page.dart` 中正确地导入了 `flutter_base` 包。你可以在文件开头添加以下代码: import 'package:flutter_base/flutter_base.dart'; 确保包的名称与你在 `pubspec.yaml` 中声明的名称一致。