Unresolved References After Flutter 3.29.0: PluginRegistrantCallback, ShimPluginRegistry
After updating Flutter to version 3.29.0 (stable), the sample app does not work. The following errors appear Execution failed for task ':huawei_push:compileDebugJavaWithJavac':
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
^
.pub-cache/git/hms-flutter-plugin-9d47f5aaa11d4474b37b83e42d073f05ebaa2e24/flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/backgroundmessaging/FlutterBackgroundRunner.java:47: error: cannot find symbol
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
^
symbol: class PluginRegistrantCallback
location: interface PluginRegistry
.pub-cache/git/hms-flutter-plugin-9d47f5aaa11d4474b37b83e42d073f05ebaa2e24/flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/backgroundmessaging/BackgroundMessagingService.java:48: error: cannot find symbol
public static void setPluginRegistrantCallback(final PluginRegistrantCallback callback) {
^
symbol: class PluginRegistrantCallback
location: class BackgroundMessagingService
.pub-cache/git/hms-flutter-plugin-9d47f5aaa11d4474b37b83e42d073f05ebaa2e24/flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/backgroundmessaging/FlutterBackgroundRunner.java:64: error: cannot find symbol
private static PluginRegistrantCallback pluginRegistrantCallback;
^
symbol: class PluginRegistrantCallback
location: class FlutterBackgroundRunner
.pub-cache/git/hms-flutter-plugin-9d47f5aaa11d4474b37b83e42d073f05ebaa2e24/flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/backgroundmessaging/FlutterBackgroundRunner.java:75: error: cannot find symbol
public static void setPluginRegistrantCallback(final PluginRegistrantCallback callback) {
^
symbol: class PluginRegistrantCallback
location: class FlutterBackgroundRunner
Flutter 3.29.0, they removed support for the old v1 plugins.
Same problem here but with flutter-hms-map
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/utils/Convert.java:77: error: cannot find symbol
import io.flutter.view.FlutterMain;
^
symbol: class FlutterMain
location: package io.flutter.view
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/map/MapController.java:85: error: cannot find symbol
private final PluginRegistry.Registrar registrar;
^
symbol: class Registrar
location: interface PluginRegistry
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/map/MapController.java:157: error: cannot find symbol
final PluginRegistry.Registrar registrar, final int registrarActivityHashCode, final HuaweiMapOptions options) {
^
symbol: class Registrar
location: interface PluginRegistry
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/map/MapBuilder.java:101: error: cannot find symbol
final Lifecycle lifecycle, final PluginRegistry.Registrar registrar, final int activityHashCode) {
^
symbol: class Registrar
location: interface PluginRegistry
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/map/MapFactory.java:54: error: cannot find symbol
private final PluginRegistry.Registrar registrar;
^
symbol: class Registrar
location: interface PluginRegistry
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/map/MapFactory.java:57: error: cannot find symbol
final Lifecycle lifecycle, final PluginRegistry.Registrar registrar, final int activityHashCode) {
^
symbol: class Registrar
location: interface PluginRegistry
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/utils/Convert.java:200: error: cannot find symbol
FlutterMain.getLookupKeyForAsset(Convert.toString(data.get(1))));
^
symbol: variable FlutterMain
location: class Convert
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/utils/Convert.java:203: error: cannot find symbol
FlutterMain.getLookupKeyForAsset(Convert.toString(data.get(1)), Convert.toString(data.get(2))));
^
symbol: variable FlutterMain
location: class Convert
/Users/leonardo/.pub-cache/git/hms-flutter-plugin-d5eb4fa83cac759aa92205408d7d4eb6d7f516b4/flutter-hms-map/android/src/main/java/com/huawei/hms/flutter/map/utils/Convert.java:208: error: cannot find symbol
FlutterMain.getLookupKeyForAsset(Convert.toString(data.get(1))));
^
symbol: variable FlutterMain
location: class Convert
any solution?
@tiltmaster for now you can manually go edit out those lines in the package (make a local copy). But it seems Huawei no longer supports the Flutter platform so we are considering stopping development for App Gallery.
is there any reference for editting those lines? i have same issue too
Hi! Same issue here with hms push and hms availability. I used flutter downgrade to go back to the last version before 3.29 in the stable branch (which is provided as 3.24.5). The app build is working again for now. Hopefully Huawei does not drop development for their flutter plugins, hoping for a fix.
Best regards, Peter
For the flutter-hms-push plugin, here is a temporary solution. Update your pubspec.yaml:
dependencies:
huawei_push:
git:
url: https://github.com/crasowas/hms-flutter-plugin.git
path: flutter-hms-push
Thanks! Huawei please respond soon with some indication that you are still committed to support Flutter 🙏. We'll probably stop supporting Huawei App Gallery if we don't get some feedback
For the flutter-hms-map plugin there are some commits and you can use as a temporary solution.
huawei_map:
git:
url: https://github.com/fleoparra/hms-flutter-plugin.git
path: flutter-hms-map
same issue for push lib