shounakmulay / Telephony

Flutter plugin for telephony features like query device sms directory, listen for incoming messages, retrieve various network parameters, etc.
https://telephony.shounakmulay.dev
MIT License
137 stars 121 forks source link

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

Open mazharulsabbir opened 1 year ago

mazharulsabbir commented 1 year ago

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.

au-top commented 1 year ago

use flutter version 3.0.4

EngOmarDr commented 1 year ago

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

mazharulsabbir commented 1 year ago

I didn't get any.

ozbply commented 1 year ago

I have the same problem

NamBuiDanh2001 commented 1 year ago

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

ozbply commented 1 year ago

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

not working problem is telephony

mahesh-gubbi commented 1 year ago

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

ParhaMDeF commented 1 year ago

I have this issue too. any update?

definev commented 1 year ago

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
ParhaMDeF commented 1 year ago

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👏

amresh4448 commented 1 year ago

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 commented 1 year ago

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

khanakia commented 1 year ago

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

khanakia commented 1 year ago

@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

amresh4448 commented 1 year ago

[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 commented 1 year ago
  # 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: @.***>