rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 328 forks source link

No such module 'background_locator' #242

Closed heshesh2010 closed 3 years ago

heshesh2010 commented 3 years ago
 import UIKit

import Flutter import background_locator import GoogleMaps

func registerPlugins(registry: FlutterPluginRegistry) -> () { if (!registry.hasPlugin("BackgroundLocatorPlugin")) { GeneratedPluginRegistrant.register(with: registry) } }

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GMSServices.provideAPIKey("AIzaSyDp-D_DEMHu0qSDQePUommk6Z5AfGknBig") BackgroundLocatorPlugin.setPluginRegistrantCallback(registerPlugins) GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } }

mehdok commented 3 years ago

Hi @heshesh2010 Thank you for opening an issue;

please sync your pobspec.yaml by running flutter pub get; If it didn't help run pod install in iOS directory;

fauzipadlaw commented 3 years ago

I ran flutter pub get and pod install, it still doesn't work:

› flutter doctor -v
[✓] Flutter (Channel master, 2.4.0-5.0.pre.148, on macOS 11.5 20G71 darwin-arm,
    locale en)
    • Flutter version 2.4.0-5.0.pre.148 at /Users/efzet/SDKs/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a321515273 (5 hours ago), 2021-07-22 12:06:09 -0400
    • Engine revision d6c05fe884
    • Dart version 2.14.0 (build 2.14.0-341.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/efzet/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/efzet/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave
      Browser

[✓] Android Studio (version 4.1)
    • 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
      1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 58.0.2
    • Dart plugin version 203.8292

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

[✓] Connected device (2 available)
    • iPhone 12 (mobile) • ECAD62FB-8270-4F95-841E-12EE0B1633E0 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)       • chrome                               • web-javascript
      • Brave Browser 91.1.26.77

• No issues found!