android - 不支持的 Android 插件版本 : 3. 5.3。升级flutter 1.12.13+hotfix.5后

标签 android flutter android-gradle-plugin

我已将 flutter 升级到 1.12.13+hotfix.5,之后出现错误 Unsuported Android Plugin version: 3.5.3.

当我将 gradle 构建降级到 3.5.2、3.5.1、3.5.0+ 时,它显示以下错误:

Finished with error: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\TiwariA\Documents\X-Project\build, but the tool couldn't find it.

下面是flutter doctor的结果截图:

enter image description here

在控制台中低于警告

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\package_info-0.4.0+13\android\src\main\java\io\flutter\plugins\packageinfo\PackageInfoPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\device_info-0.4.1+4\android\src\main\java\io\flutter\plugins\deviceinfo\DeviceInfoPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core-0.4.3+1\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.13.0+1\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_messaging-6.0.9\android\src\main\java\io\flutter\plugins\firebasemessaging\FirebaseMessagingPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.5.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details. C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext()); ^ 1 warning Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Finished with error: Unsuported Android Plugin version: 3.5.3.

最佳答案

我遇到了同样的问题。

这很奇怪,但这是因为如果在我的 app/build.gradle 中定义 productFlavors 而不是将 --flavor 传递给 flutter run . (例如。flutter run --flavor myApp

添加后对我有用...

关于android - 不支持的 Android 插件版本 : 3. 5.3。升级flutter 1.12.13+hotfix.5后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59433287/

相关文章:

android - sqlite 函数在给定日期中显示月份?

java - 当设备方向改变时,Qr 扫描应用程序崩溃

flutter - 从有状态小部件中的 FormField 扩展

android - 项目构建失败 : Task 'compileDebug' is ambiguous in root project

android - 错误 :Execution failed for task ':ProjectName:mergeDebugResources' . > Crunching Cruncher *some file* 失败,请参阅日志

android - 远程媒体播放器 HTTP 响应处理

Android SAF,无法复制文件,未设置 FLAG_SUPPORTS_COPY

dart - 如何将新表添加到sqlite?

firebase - Flutter:可以等待同级小部件完成构建吗?

android - java.lang.IncompatibleClassChangeError 导致应用程序崩溃,使用 Firebase 和 Google Play 服务