Error:
warnings
e: file:///C:/Users/dharm/AppData/Local/Pub/Cache/hosted/pub.dev/paytm_allinonesdk-1.2.8/android/src/main/kotlin/com/paytm/allinonesdk/AllInOneSdkPlugin.kt:21:48 Unresolved reference 'Registrar'.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':paytm_allinonesdk:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more 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 59s
Error: Gradle task assembleDebug failed with exit code 1
Solution:
Try the Latest Version
First, check your pubspec.yaml to make sure you are using the newest version of paytm_allinonesdk.
Run this command in your terminal to upgrade:
flutter pub upgrade paytm_allinonesdk
If you are already using the latest version (such as 1.2.8) and still see the error, it means the plugin is not yet properly migrated to work with the latest Flutter.
2. Check Plugin Author or Repository
Go to the plugin’s pub.dev page or its GitHub repository.
- Look for any Pull Requests (PRs) or ongoing work about “FlutterPlugin API migration”.
- If it’s actively maintained, you can wait for the update or raise an issue/ticket to request migration for the latest Flutter version.
3. Temporary Solution
- Use an alternate payment plugin such as Razorpay, Stripe, or PhonePe, which supports the latest Flutter SDK.
- As a last resort, you can downgrade your Flutter project to an older version (like Flutter 2), but this is not recommended for security and future compatibility.
4. Do-It-Yourself Migration (Advanced)
If you have advanced knowledge of Java/Kotlin and Flutter plugin development:
- Fork the plugin’s source code.
- Manually replace usage of the old Registrar API with the modern FlutterPlugin API.
- This is complex and only suggested if you are comfortable maintaining your own plugin version.
5. Check for Community Forks
Sometimes, another developer or the community may have already forked and fixed the plugin.
- Check pub.dev, GitHub, or Stack Overflow for community versions or forks that have resolved this issue.

Leave a Reply