引入flutter_webview_plugin报错
来源:12-10 基于自定义WebView实现H5混合开发-3【H5混合实战】

鸡毛哥
2020-01-03
Launching lib\main.dart on X900 in debug mode…
[!] Your app isn’t using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.
Running Gradle task ‘assembleDebug’…
D:\Flutter\Projects\flutter_trip\flutter_trip\android\app\src\debug\AndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.1.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:8:5-29:19 to override.
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:app:processDebugManifest’.
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.1.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:8:5-29:19 to override.
-
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 5s
AndroidX incompatibilities may have caused this build to fail. Please migrate your app to AndroidX. See https://goo.gl/CP92wY.
Finished with error: Gradle task assembleDebug failed with exit code 1
以上是报错信息,不知道如何解决
2回答
-
CrazyCodeBoy
2020-01-05
你的项目不支持Android x,但你使用了基于Android X的flutter_webview_plugin 插件,所以导致的这个问题;
安装下非Android x版本的flutter_webview_plugin试一下:
dependencies: flutter_webview_plugin: ^0.3.2
可参考下:https://pub.dev/packages/flutter_webview_plugin#033
10 -
鸡毛哥
提问者
2020-01-05
谢谢 我已经通过之前的视频把项目改成支持androidx 了 谢谢
00
相似问题
回答 2
回答 1