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

Library not found in ISO release mode #113

Open
mal33k-eden opened this issue Jul 5, 2022 · 9 comments
Open

Library not found in ISO release mode #113

mal33k-eden opened this issue Jul 5, 2022 · 9 comments

Comments

@mal33k-eden
Copy link

Hello i am using the flutter_isolate plugin to call some apis and update sqflite db on the mobile app.Everything works as expected when tested in debug mode but when in release mode i get this errors in xcode:


2022-07-05 15:01:03.289687-0700 Runner[910:32263] [VERBOSE-2:shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:flutter_isolate/flutter_isolate.dart' not found.
2022-07-05 15:01:03.289804-0700 Runner[910:32263] [VERBOSE-2:dart_isolate.cc(669)] Could not resolve main entrypoint function.
2022-07-05 15:01:03.289840-0700 Runner[910:32263] [VERBOSE-2:dart_isolate.cc(167)] Could not run the run main Dart entrypoint.
2022-07-05 15:01:03.290833-0700 Runner[910:32263] [VERBOSE-2:runtime_controller.cc(385)] Could not create root isolate.
2022-07-05 15:01:03.290886-0700 Runner[910:32263] [VERBOSE-2:shell.cc(604)] Could not launch engine with configuration.

i am not sure what the challenge is.
Screenshot 2022-07-05 at 15 23 39

this is how my main() looks like

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  DartPluginRegistrant.ensureInitialized();
  await localTokenManager.ensureFreshInstall();
  await dotenv.load();
  HttpOverrides.global = MyHttpOverrides();
  
  runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider<AuthProvider>(create: (_) => AuthProvider()),
    ],
    child: SplashScreen(),
  ));
}
@nmfisher
Copy link
Collaborator

nmfisher commented Jul 6, 2022

Where are you spawning your isolate?

@mal33k-eden
Copy link
Author

i am spawning it in a service class.

service.dart

class AssetStreamer {
Future<void> refreshAssetBalance(String s) async { 
    try {
      await FlutterIsolate.spawn(updateAssetBalance, null); 
      
      notifyListeners();
      // ignore: empty_catches
    } catch (e) {
      print(e);
    }
  }
}

i am calling AssetStreamer().refreshAssetBalance in the initState of certain views

@nmfisher
Copy link
Collaborator

nmfisher commented Jul 8, 2022

Can you reproduce this in a standalone project? It looks like a local project issue (have you tried running flutter clean and running outside Xcode?)

@nmfisher
Copy link
Collaborator

@mal33k-eden Any update? Will close unless response received.

@fred-derf
Copy link

I have the same issue trying to use this as well on android in release mode, debug and profile work great. Release or release via flutter build apk has the same error:

E/flutter ( 6069): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:flutter_isolate/flutter_isolate.dart' not found.
E/flutter ( 6069): [ERROR:flutter/runtime/dart_isolate.cc(668)] Could not resolve main entrypoint function.
E/flutter ( 6069): [ERROR:flutter/runtime/dart_isolate.cc(167)] Could not run the run main Dart entrypoint.
E/flutter ( 6069): [ERROR:flutter/runtime/runtime_controller.cc(386)] Could not create root isolate.

I'll try to make a standalone project.

@fred-derf
Copy link

This happens with any example, even the simplest possible example when running in release mode on a physical android device but doesn't happen in flutter channel stable.

Flutter channel beta and master are currently broken and will throw this error.

@fred-derf
Copy link

Obfuscation also causes the same error with flutter channel stable:

E/flutter (10321): [ERROR:flutter/shell/common/shell.cc(93)] Dart Unhandled Exception: NoSuchMethodError: No top-level getter '_Lee' declared.
E/flutter (10321): Receiver: top-level
E/flutter (10321): Tried calling: _Lee, stack trace: Warning: This VM has been configured to produce stack traces that violate the Dart standard.
E/flutter (10321): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/flutter (10321): pid: 10321, tid: 10361, name Unknown
E/flutter (10321): build_id: '7f1b36b85f33f8c8d348edb2f03a7930'
E/flutter (10321): isolate_dso_base: 8e580000, vm_dso_base: 8e580000
E/flutter (10321): isolate_instructions: 8e75bbd0, vm_instructions: 8e758000
E/flutter (10321): #00 abs 8e77fcab virt 001ffcab _kDartIsolateSnapshotInstructions+0x240db
E/flutter (10321):
E/flutter (10321): [ERROR:flutter/runtime/dart_isolate.cc(668)] Could not resolve main entrypoint function.
E/flutter (10321): [ERROR:flutter/runtime/dart_isolate.cc(167)] Could not run the run main Dart entrypoint.
E/flutter (10321): [ERROR:flutter/runtime/runtime_controller.cc(382)] Could not create root isolate.
E/flutter (10321): [ERROR:flutter/shell/common/shell.cc(600)] Could not launch engine with configuration.

@srmncnk
Copy link

srmncnk commented Sep 5, 2022

Maybe it is related to this?
dart-lang/sdk#49181

@srmncnk
Copy link

srmncnk commented Sep 6, 2022

This PR should fix it. #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants