screen_retriever icon indicating copy to clipboard operation
screen_retriever copied to clipboard

no such module 'screen_retriever'

Open TheGlorySaint opened this issue 1 year ago • 1 comments

Dear leanflutter Org,

I want to use your window_manger plugin, but I get the following error when running the application.

/Users/USER/Documents/Development/privat/REPO/macos/Flutter/GeneratedPluginRegistrant.swift:8:8: error: no such module 'screen_retriever'
import screen_retriever

I have followed the installation instruction with adding window_manager 0.3.7 to the pubspec.yaml. In the main.dart i also added ensureInitialized. Attatched is my main.dart file. I have looked into the GeneratedPluginRegistrant file, there is the import screen_retriever added as well as the import window_manager. Also tried pod install --repo-update in the ./macOS path. flutter clean does also not help.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await windowManager.ensureInitialized();

  try {
    if (Platform.isWindows || Platform.isMacOS) {
      var windowOptions = const WindowOptions(size: Size(800, 600));

      await windowManager.waitUntilReadyToShow(windowOptions, () async {
        await windowManager.show();
        await windowManager.focus();
      });
    }

    setupServices();

    logger(message: 'Waiting for services');

    await services.allReady();

    runApp(const MainApp());
  } catch (error) {
    logger(message: '$error');
  }
}

TheGlorySaint avatar Nov 24 '23 16:11 TheGlorySaint

do you solve this issue? I got the same error😰 image

0renlyhuang avatar Nov 25 '23 16:11 0renlyhuang

Please run flutter run -d macos in the terminal before opening Xcode

lijy91 avatar Aug 18 '24 06:08 lijy91