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

location_callback_handler.dart not found when run release project #348

Open
ARoSistemas opened this issue Sep 23, 2022 · 5 comments
Open

Comments

@ARoSistemas
Copy link

ARoSistemas commented Sep 23, 2022

Upgrade my proyect to:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Versi¢n 10.0.22000.978], locale es-MX)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.69.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

and plugin not works!

debug console::

Launching lib\main.dart on SM A225M in debug mode...
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (25, 1): Class 'BackgroundLocatorPlugin' is not abstract and does not implement abstract member public abstract fun onNewIntent(p0: Intent): Boolean defined in io.flutter.plugin.common.PluginRegistry.NewIntentListener
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (215, 43): Type mismatch: inferred type is Map<Any, Any>? but Map<Any, Any> was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (215, 48): Type mismatch: inferred type is Map<Any, Any>? but Map<Any, Any> was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (224, 43): Type mismatch: inferred type is Map<Any, Any>? but Map<Any, Any> was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (224, 48): Type mismatch: inferred type is Map<Any, Any>? but Map<Any, Any> was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (243, 43): Type mismatch: inferred type is Map<Any, Any>? but Map<Any, Any> was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (243, 48): Type mismatch: inferred type is Map<Any, Any>? but Map<Any, Any> was expected

e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (266, 5): 'onNewIntent' overrides nothing
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\BackgroundLocatorPlugin.kt: (275, 35): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\IsolateHolderExtension.kt: (42, 27): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected

e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\IsolateHolderService.kt: (269, 35): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\pluggables\DisposePluggable.kt: (17, 51): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\src\main\kotlin\rekab\app\background_locator\pluggables\InitPluggable.kt: (22, 55): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':background_locator:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 8s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

so, searching looking for, I found ::

https://github.com/imsamgarg/background_locator

And add to pubspec.yml

background_locator:
git:
url: https://github.com/imsamgarg/background_locator
ref: master

And works only on debug mode !!!

when I run flutter on console ::

flutter run --release

the plugin not works again!!!!!

errors ::

E/flutter (11228): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:myprojectone/repository/location_callback_handler.dart' not found.

@jesussmile
Copy link

yes same issue any fix..? this is after the recent updates on flutter side

@jesussmile
Copy link

@ARoSistemas can you post your pubspec.yaml

@ARoSistemas
Copy link
Author

Resolved!!!!!

1.- flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Versi¢n 10.0.22000.978], locale es-MX)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.69.2)
[√] Connected device (6 available)
[√] HTTP Host Availability

2.- In Pubspec.yml add this

   **background_locator_2: ^2.0.5**

  the version 1 to backgroud locator **not works on Flutter 3**

Remember :: The version of Dart is 3.0.2 only.

I test with version 3.3.2 and NOT WORKS

@jesussmile check it, and comments your results

@jesussmile
Copy link

Resolved!!!!!

1.- flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Versi¢n 10.0.22000.978], locale es-MX) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6) [√] Android Studio (version 2021.2) [√] VS Code (version 1.69.2) [√] Connected device (6 available) [√] HTTP Host Availability

2.- In Pubspec.yml add this

   **background_locator_2: ^2.0.5**

  the version 1 to backgroud locator **not works on Flutter 3**

Remember :: The version of Dart is 3.0.2 only.

I test with version 3.3.2 and NOT WORKS

@jesussmile check it, and comments your results

Thanx works fine .

@pnthari
Copy link

pnthari commented May 22, 2023

Add @pragma('vm:entry-point') in location_callback_handler.dart file

@pragma('vm:entry-point')
static Future<void> callback(LocationDto locationDto) async {
    LocationServiceRepository myLocationCallbackRepository = LocationServiceRepository();
    await myLocationCallbackRepository.callback(locationDto);
  }

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

No branches or pull requests

3 participants