Skip to content

[Bug]: Dependencies targeting android 34 cannot use battery_plus #1810

Closed
@reidbaker

Description

@reidbaker

Platform

Android api 34

Plugin

battery_plus

Version

4.0.0

Flutter SDK

Main

Steps to reproduce

Android API 34 will enforce broadcast receivers to declare if they wish to be exported.

Battery plus uses a broadcast receiver and does not specify if it is exported apps targeting api 34 will not be able to compile if using battery plus.

I tried to find publicly available documentation or comment that this is happening but everything I found is internal.
This was found because of a google customer of battery plus trying to compile against the latest 34 implementation.

More context:
https://developer.android.com/guide/components/broadcasts#context-registered-receivers
https://developer.android.com/guide/topics/manifest/receiver-element
https://developer.android.com/reference/androidx/core/content/ContextCompat#registerReceiver(android.content.Context,android.content.BroadcastReceiver,android.content.IntentFilter,int)

Code Sample

No response

Logs

<can not share>

Flutter Doctor

Irrelevant

Checklist before submitting a bug

  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions