Skip to content

[Bug]: Re-introduce Huawei HMS support #1629

@renier-botes

Description

@renier-botes

Required Reading

  • Confirmed

Plugin Version

4.18.2

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.8, on macOS 26.2 25C56 darwin-arm64, locale en-ZA)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[!] Xcode - develop for iOS and macOS (Xcode 26.2)
    ✗ Xcode requires additional components to be installed in order to run.
      Launch Xcode and install additional required components when prompted or run:
        sudo xcodebuild -runFirstLaunch
[✓] Chrome - develop for the web
[✓] Connected device (5 available)
[✓] Network resources

! Doctor found issues in 1 category.

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Huawei P40

Device operating-systems(s)

EMUI 12.0.0

What happened?

Seeing a dialog with this message when running my app:

app won't run without Google Play services, which are not supported by your device.

Huawei has added support for 16 KB page size:
https://developer.huawei.com/consumer/en/doc/HMSCore-Guides/version-change-history-0000001050986155#section4237144414316

Plugin Code and/or Config

wait bg.BackgroundGeolocation.ready(
  bg.Config(
    reset: true,
    // Geolocation Options
    desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
    showsBackgroundLocationIndicator: false,
    isMoving: true,
    // Application Options
    heartbeatInterval: 3600,
    enableHeadless: !kIsWeb && defaultTargetPlatform == TargetPlatform.android,
    backgroundPermissionRationale: bg.PermissionRationale(message: _getLocationRationale()),
    locationAuthorizationRequest: 'WhenInUse',
    locationAuthorizationAlert: _getAuthorizationAlert(),
    preventSuspend: false,
    stopOnTerminate: false,
    startOnBoot: true,
    // HTTP & Persistence
    authorization: bg.Authorization(accessToken: user.uid),
    url: '${EnvironmentConfig.API_URL}/background-geolocation',
    headers: {},
    autoSync: true,
    autoSyncThreshold: 0,
    batchSync: true,
    maxBatchSize: 10,
    maxDaysToPersist: 1,
    maxRecordsToPersist: 20,
    // Logging & Debug
    debug: false,
    logLevel: bg.Config.LOG_LEVEL_OFF,
    extras: {
      'userId': user.id,
    },
  ),
);

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions