Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get it to work on New Flutter application #226

Closed
lohanidamodar opened this issue Jul 1, 2023 · 1 comment
Closed

Unable to get it to work on New Flutter application #226

lohanidamodar opened this issue Jul 1, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@lohanidamodar
Copy link

lohanidamodar commented Jul 1, 2023

Hey I'm trying to use mimir in my Flutter project. I just added the following code and run on macOS

import 'package:flutter/material.dart';
import 'package:flutter_mimir/flutter_mimir.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Mimir.defaultInstance;
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(),
    );
  }
}

When I run, immediately get the following error

Exception has occurred.
FfiException (FfiException(RESULT_ERROR, Operation not permitted (os error 1), null))

The error is thrown in the getInstance function of the package

Future<MimirInstance> getInstance({
    required String path,
    required ExternalLibrary library,
  }) async {
    _milli ??= createWrapperImpl(library);
    await _milli!
        .ensureInstanceInitialized(instanceDir: path, tmpDir: tmpDir());
    return _instances.putIfAbsent(
      path,
      () => MimirInstanceImpl(path, _milli!),
    );
  }

Flutter Doctor

[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4 22F66 darwin-arm64, locale en-NP)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
@lohanidamodar lohanidamodar changed the title Unable to get it to work on Flutter application Unable to get it to work on New Flutter application Jul 1, 2023
@GregoryConrad
Copy link
Owner

Hi 👋

I forgot to add macOS-specific setup info in the documentation. You need to disable macOS’ app sandbox in order to use Mimir at the moment (which also means you can’t submit to the Mac App Store, but can still distribute macOS applications yourself)

I’ll leave this open until I can fix the docs

@GregoryConrad GregoryConrad added the documentation Improvements or additions to documentation label Jul 2, 2023
GregoryConrad added a commit that referenced this issue Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants