Android build fails with 'cannot find symbol PluginRegistry.Registrar' in a Flutter plugin
error: cannot find symbolShort 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.
Fix it fast
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 --debug2Match what you see, then jump to its fix
- 1
the 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
the error path is in android/app/src/main in your projectYour own Android code still uses the v1 embedding classesFix - 3
the failing project is the plugin's own android moduleYou maintain the plugin and it supports only the old APIFix
- 1
What does the error look like?
error: cannot find symbolPluginRegistry.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 outdated2Fix
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 get3Verify
The build passes the plugin's Java step.
flutter build apk --debugConfirmed by docs.flutter.dev
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/src2Fix
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 --debugConfirmed by docs.flutter.dev
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/src2Fix
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 --debugConfirmed by docs.flutter.dev
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
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 fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fixMobile apps
Android resource linking fails with resource android:attr/lStar not found
error: failed linking references.
The lStar attribute exists only from Android API 31.
2 causes, each with a fix