Telephony icon indicating copy to clipboard operation
Telephony copied to clipboard

Dart Error: Dart_LookupLibrary: library 'package:telephony/telephony.dart' not found.

Open mazharulsabbir opened this issue 2 years ago • 16 comments

Hello, I am getting the below error when,

  1. I run app in release mode using flutter run --release
  2. App is running in background,

Note: App is working fine on foreground. I have disabled battery optimization from my device

E/flutter ( 9686): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:telephony/telephony.dart' not found. E/flutter ( 9686): [ERROR:flutter/runtime/dart_isolate.cc(668)] Could not resolve main entrypoint function. E/flutter ( 9686): [ERROR:flutter/runtime/dart_isolate.cc(167)] Could not run the run main Dart entrypoint. E/flutter ( 9686): [ERROR:flutter/runtime/runtime_controller.cc(385)] Could not create root isolate. E/flutter ( 9686): [ERROR:flutter/shell/common/shell.cc(604)] Could not launch engine with configuration.

mazharulsabbir avatar Oct 08 '22 20:10 mazharulsabbir

use flutter version 3.0.4

au-top avatar Oct 13 '22 02:10 au-top

@mazharulsabbir I have the same problem what is the best solution ?

EngOmarDr avatar Oct 17 '22 12:10 EngOmarDr

I didn't get any.

mazharulsabbir avatar Oct 17 '22 12:10 mazharulsabbir

I have the same problem

ozbply avatar Nov 02 '22 12:11 ozbply

add @pragma('vm:entry-point') to background entry-point function

NamBuiDanh2001 avatar Nov 11 '22 07:11 NamBuiDanh2001

Ekle@pragma('vm:giriş noktası') arka plan giriş noktası işlevine

not working problem is telephony

ozbply avatar Nov 12 '22 01:11 ozbply

Am also facing the same issue, please give some updates. Thank you.

mahesh-gubbi avatar Nov 18 '22 06:11 mahesh-gubbi

I have this issue too. any update?

ParhaMDeF avatar Dec 02 '22 13:12 ParhaMDeF

This will fix this issue #168. For the time waiting until it's merged you can use my clone directly.

telephony:
  git:
    url: https://github.com/definev/Telephony.git
    ref: develop

definev avatar Dec 03 '22 18:12 definev

This will fix this issue #168. For the time waiting until it's merged you can use my clone directly.

telephony:
  git:
    url: https://github.com/definev/Telephony.git
    ref: develop

You are a lifesaver bro👏

ParhaMDeF avatar Dec 04 '22 17:12 ParhaMDeF

flutter run --release

E/flutter (22741): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:telephony/telephony.dart' not found. E/flutter (22741): [ERROR:flutter/runtime/dart_isolate.cc(668)] Could not resolve main entrypoint function. E/flutter (22741): [ERROR:flutter/runtime/dart_isolate.cc(167)] Could not run the run main Dart entrypoint. E/flutter (22741): [ERROR:flutter/runtime/runtime_controller.cc(385)] Could not create root isolate. E/flutter (22741): [ERROR:flutter/shell/common/shell.cc(604)] Could not launch engine with configuration.

how can i solve this issue Amresh

amresh4448 avatar Jan 23 '23 11:01 amresh4448

working on debug mode but not working on Relase mode in flutter

amresh4448 avatar Jan 23 '23 11:01 amresh4448

I am having the same issue works on debug mode but not on the release mode

khanakia avatar Feb 02 '23 08:02 khanakia

@definev @ParhaMDeF I am getting this error now after adding @pragma('vm:entry-point') this

    NoSuchMethodError: No top-level getter 'onBackgroundMessage' declared.
    Receiver: top-level
    Tried calling: onBackgroundMessage

Note i have already a top level custom onBackgroundMessage as i am using the telephone example from the repo

khanakia avatar Feb 02 '23 08:02 khanakia

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(failed_to_fetch_sms, Flutter Telephony: Error getting SmsManager, null, null) E/flutter ( 5660): #0 StandardMethodCodec.decodeEnvelope message_codecs.dart:653 E/flutter ( 5660): #1 MethodChannel._invokeMethod platform_channel.dart:296 E/flutter ( 5660): E/flutter ( 5660): #2 Telephony.sendSms telephony.dart:321 E/flutter ( 5660): E/flutter ( 5660): #3 _home_pageState.build. home_page.dart:258 E/flutter ( 5660): E/flutter ( 5660):

how to solve this issue

amresh4448 avatar Feb 03 '23 09:02 amresh4448

  # url: https://github.com/suhardik/s_telephony.git

On Thu, Feb 2, 2023 at 1:54 PM Aman Bansal @.***> wrote:

@ParhaMDeF https://github.com/ParhaMDeF I am getting this error now after adding @pragma('vm:entry-point') this

NoSuchMethodError: No top-level getter 'onBackgroundMessage' declared.
Receiver: top-level
Tried calling: onBackgroundMessage

Note i have already a top level custom onBackgroundMessage as i am using the telephone example from the repo

— Reply to this email directly, view it on GitHub https://github.com/shounakmulay/Telephony/issues/165#issuecomment-1413326545, or unsubscribe https://github.com/notifications/unsubscribe-auth/APLA7YDRYTF7KIYN5YOWZ43WVNVNNANCNFSM6AAAAAARAMRWXU . You are receiving this because you commented.Message ID: @.***>

amresh4448 avatar Feb 06 '23 10:02 amresh4448