Flutter : error: package io.flutter.embedding.engine.plugins does not exist

Viewed 2244

How to Fix This Error I try to (Flutter Run)Debug my Code & Test App in flutter showing this error... before this i have Gradle Build error i fix it after that showing

Minimum supported Gradle version is 5.6.4. Current version is 5.6.2. If using the gradle wrapper, try editing the distributionUrl

i trying to update gradle version after than showing this error ):

**> event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get" in play_big_win...}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib\main.dart on sdk gphone x86 in debug mode...
 lib\main.dart
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:14: error: package io.flutter.embedding.engine.plugins does not exist
import io.flutter.embedding.engine.plugins.FlutterPlugin;
                                          ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:15: error: package io.flutter.plugin.common does not exist
import io.flutter.plugin.common.MethodCall;
                               ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:16: error: package io.flutter.plugin.common does not exist
import io.flutter.plugin.common.MethodChannel;
                               ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:17: error: package io.flutter.plugin.common does not exist
import io.flutter.plugin.common.PluginRegistry;
                               ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:29: error: cannot find symbol
public class FlutterFirebaseCorePlugin implements FlutterPlugin, MethodChannel.MethodCallHandler {
                                                  ^
  symbol: class FlutterPlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:29: error: package MethodChannel does not exist
public class FlutterFirebaseCorePlugin implements FlutterPlugin, MethodChannel.MethodCallHandler {
                                                                              ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:47: error: cannot find symbol
  private MethodChannel channel;
          ^
  symbol:   class MethodChannel
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:71: error: package PluginRegistry does not exist
  public static void registerWith(PluginRegistry.Registrar registrar) {
                                                ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:77: error: cannot find symbol
  public void onAttachedToEngine(FlutterPluginBinding binding) {
                                 ^
  symbol:   class FlutterPluginBinding
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:84: error: cannot find symbol
  public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
                                            ^
  symbol:   class FlutterPluginBinding
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:223: error: cannot find symbol
  public void onMethodCall(MethodCall call, @NonNull final MethodChannel.Result result) {
                           ^
  symbol:   class MethodCall
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:223: error: package MethodChannel does not exist
  public void onMethodCall(MethodCall call, @NonNull final MethodChannel.Result result) {
                                                                        ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:72: error: cannot find symbol
    final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL_NAME);
          ^
  symbol:   class MethodChannel
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:72: error: cannot find symbol
    final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL_NAME);
                                      ^
  symbol:   class MethodChannel
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:76: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:79: error: cannot find symbol
    channel = new MethodChannel(binding.getBinaryMessenger(), CHANNEL_NAME);
                  ^
  symbol:   class MethodChannel
  location: class FlutterFirebaseCorePlugin
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:83: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:222: error: method does not override or implement a method from a supertype
  @Override
  ^
C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java:226: error: illegal start of type
    switch (call.method) {
           ^
19 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_core: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 6m 45s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)**
1 Answers

The error you've encountered means that you either need to migrate to AndroidX or downgrade to the plugin versions that are compatible with versions before AndroidX.

Check the following issues related to migration to AndroidX:

Check this out:

Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

Related