Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android build fails with 'cannot find symbol PluginRegistry.Registrar' in a Flutter plugin

Errorerror: cannot find symbol

Short answer

The v1 Android embedding was removed in Flutter 3.29.0, so plugin code that still has the old registerWith(Registrar) method no longer compiles. Upgrade the plugin to a release that supports the v2 embedding, or replace it. For your own code, remove registerWith and switch to the embedding classes.

  • Applies to Flutter 3.29, Flutter 3.35, Gradle 8
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read the first error in the Gradle output. The file path tells you whether the failing code is in a package under the pub cache or in your own android folder.

    flutter build apk --debug
  2. 2Match what you see, then jump to its fix

    1. 1the error path points into a plugin in the pub cache, such as .pub-cache/hosted/pub.dev/some_plugin/android/A plugin still has the old registerWith(Registrar) methodFix
    2. 2the error path is in android/app/src/main in your projectYour own Android code still uses the v1 embedding classesFix
    3. 3the failing project is the plugin's own android moduleYou maintain the plugin and it supports only the old APIFix

What does the error look like?

  • error: cannot find symbol
  • PluginRegistry.Registrar

Cause 1 of 3

A plugin still has the old registerWith(Registrar) method

1Check

Flutter's migration page tells plugin authors to remove the static registerWith method from their FlutterPlugin implementation. A plugin that did not do that fails to compile on newer Flutter.

flutter pub outdated

2Fix

Upgrade the plugin to the newest release. If the plugin is not maintained and has no release without registerWith, move to a maintained alternative.

flutter pub upgrade some_plugin
flutter clean
flutter pub get

3Verify

The build passes the plugin's Java step.

flutter build apk --debug

Confirmed by docs.flutter.dev

Did this fix it?

Cause 2 of 3

Your own Android code still uses the v1 embedding classes

1Check

Flutter 3.29.0 removed the io.flutter.app classes, among them FlutterActivity, FlutterApplication and FlutterFragmentActivity.

grep -rn "io.flutter.app" android/app/src

2Fix

Use the replacements Flutter lists: io.flutter.embedding.android.FlutterActivity for an activity, and android.app.Application for a custom Application class.

import io.flutter.embedding.android.FlutterActivity

class MainActivity : FlutterActivity()

3Verify

No io.flutter.app import is left.

grep -rn "io.flutter.app" android/app/src || echo clean
flutter build apk --debug

Confirmed by docs.flutter.dev

Did this fix it?

Cause 3 of 3

You maintain the plugin and it supports only the old API

1Check

The older plugin API was based on PluginRegistry.Registrar. The newer one is the FlutterPlugin interface, with ActivityAware when the plugin needs an Activity.

grep -rn "Registrar" android/src

2Fix

Implement FlutterPlugin with onAttachedToEngine and onDetachedFromEngine, add ActivityAware if you need an Activity, and delete registerWith.

public class MyPlugin implements FlutterPlugin {
  @Override
  public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
    // Start your plugin here.
  }

  @Override
  public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
    // Release references here.
  }
}

3Verify

Build the example app that comes with the plugin.

cd example && flutter build apk --debug

Confirmed by docs.flutter.dev

Did this fix it?

How do I stop it coming back?

  • Run flutter pub outdated before a Flutter upgrade and look for plugins with no recent release.
  • Prefer plugins that publish Android support for the v2 embedding.
  • Read the breaking-changes page for the Flutter version you are moving to.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.