Skip to content

[Compile]: Cannot find 'FLTBatteryPlusPlugin' in scope, error occurs after upgrading from ^2.x to ˆ6.x #3606

Open
@Anderson-Andre-P

Description

@Anderson-Andre-P

Operating System

Mobile - iOS

Plugin

batery_plus

Version

^6.2.1

Flutter SDK

=3.2.0 <4.0.0

Compilation command

I'm building the project directly using Xcode:

Opened the project using:
ios/Runner.xcworkspace

Selected the appropriate scheme (e.g. Runner)

Target device: physical iPhone / iOS Simulator

Build action: Product > Run (⌘R) or Product > Archive

No command-line build (e.g., flutter build ios) was used in this case.

Dart Dependencies

environment:
  sdk: ">=3.2.0 <4.0.0"

dependencies:
  after_layout: ^1.1.1+1
  battery_plus: ^6.2.1
  crypto: ^3.0.2
  cupertino_icons: ^1.0.5
  device_info_plus: ^10.1.2
  flutter:
    sdk: flutter
  flutter_local_notifications: ^18.0.1
  flutter_secure_storage: ^8.1.0
  font_awesome_flutter: ^10.4.0
  geocode: ^1.0.3
  geolocator: ^10.1.1
  google_maps_flutter: ^2.2.3
  http: ^1.3.0
  intl: ^0.18.1
  jwt_decoder: ^2.0.1
  location: ^5.0.3
  package_info_plus: ^4.0.0
  permission_handler: ^10.4.5
  sembast: 3.3.1+1
  sentry_flutter: ^8.14.2
  shared_preferences: ^2.2.3
  url_launcher: ^6.1.8
  web_socket_channel: ^2.4.0
  google_fonts: ^5.1.0
  camera: ^0.10.5+5
  open_filex: ^4.3.4
  connectivity_plus: ^4.0.2
  flutter_bluetooth_serial: ^0.4.0
  flutter_bloc: ^8.1.6
  background_locator_2:
    path: local/background_locator_2
  provider: ^6.1.4
  path_provider: ^2.0.11
  flutter_lints: ^5.0.0 
  collection: ^1.19.0
  path: ^1.9.0
  android_id: ^0.3.6

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.11.0

flutter_icons:
  android: false
  ios: true
  image_path: "assets/icon/icon.png"

flutter:
  uses-material-design: true
  assets:
    - assets/icon/
    - assets/icon/base_icon.png
    - assets/icon/double_point_icon.png
    - assets/google_fonts/
    - assets/backgrounds/
    - assets/logotipos/
  fonts:
    - family: Exo2
      fonts:
        - asset: assets/google_fonts/Exo2-Regular.ttf
        - asset: assets/google_fonts/Exo2-Bold.ttf
          weight: 700
        - asset: assets/google_fonts/Exo2-Italic.ttf
          style: italic

Native dependencies


Compilation Error

Cannot find 'FLTBatteryPlusPlugin' in scope.

This error occurs on AppDelegate.swift:


    func registerOtherPlugins() {
        if !hasPlugin("dev.fluttercommunity.plus.battery") {
            FLTBatteryPlusPlugin.register(with: registrar(forPlugin: "dev.fluttercommunity.plus.battery")!)
        }
    }

Flutter Doctor

flutter doctor -v

[✓] Flutter (Channel stable, 3.27.0, on macOS 15.5 24F74 darwin-arm64, locale pt-BR)
    • Flutter version 3.27.0 on channel stable at /Users/anderson/fvm/versions/3.27.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8495dee1fd (6 months ago), 2024-12-10 14:23:39 -0800
    • Engine revision 83bacfc525
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
    • Android SDK at /Users/anderson/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Community Edition (version 2024.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 85.3.1
    • Dart plugin version 243.26753.1

[✓] VS Code (version 1.100.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.112.0

[✓] Connected device (4 available)
    • iPhone de Testes (mobile)       • c38f0e40147560ad83b7572446c5d74adcb3e17d • ios            • iOS 15.7.2 19H218
    • macOS (desktop)                 • macos                                    • darwin-arm64   • macOS 15.5 24F74 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                    • darwin         • macOS 15.5 24F74 darwin-arm64
    • Chrome (web)                    • chrome                                   • web-javascript • Google Chrome 137.0.7151.104

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • 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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions