MissingPluginException(Keine Implementierung für die Methode OneSignal#initialize auf dem Kanal OneSignal gefundenAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 MissingPluginException(Keine Implementierung für die Methode OneSignal#initialize auf dem Kanal OneSignal gefunden

Post by Anonymous »

Was ist passiert?
App startet nicht ordnungsgemäß (MissingPluginException (Keine Implementierung für Methode OneSignal#initialize auf Kanal OneSignal gefunden)
aufgrund eines OneSignal-Paketproblems, das NUR beim Android Release Build auftritt, beim Android Debug Build funktioniert es einwandfrei. Unter iOS funktioniert es auch einwandfrei.
Protokolle:

Code: Select all

✓ Built build/app/outputs/flutter-apk/app-release.apk (43.4MB)
I/flutter (15134): [IMPORTANT:flutter/shell/platform/android/android_context_gl_impeller.cc(94)] Using the Impeller rendering backend (OpenGLES).
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#initialize on channel OneSignal)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134):
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#lifecycleInit on channel OneSignal#inappmessages)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134): #1      OneSignalInAppMessages.lifecycleInit (package:onesignal_flutter/src/inappmessages.dart:77)
E/flutter (15134): 
E/flutter (15134):
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#lifecycleInit on channel OneSignal#user)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134): #1      OneSignalUser.lifecycleInit (package:onesignal_flutter/src/user.dart:197)
E/flutter (15134): 
E/flutter (15134):
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#pushSubscriptionToken on channel OneSignal#pushsubscription)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134): #1      OneSignalPushSubscription.lifecycleInit (package:onesignal_flutter/src/pushsubscription.dart:66)
E/flutter (15134): 
E/flutter (15134):
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#permission on channel OneSignal#notifications)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134): #1      OneSignalNotifications.lifecycleInit (package:onesignal_flutter/src/notifications.dart:118)
E/flutter (15134): 
E/flutter (15134):
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#requestPermission on channel OneSignal#notifications)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134): #1      OneSignalNotifications.requestPermission (package:onesignal_flutter/src/notifications.dart:88)
E/flutter (15134): 
E/flutter (15134): #2      main. (package:iu_app/main.dart:87)
E/flutter (15134): 
E/flutter (15134):
E/flutter (15134): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#addNativeClickListener on channel OneSignal#notifications)
E/flutter (15134): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368)
E/flutter (15134): 
E/flutter (15134):
Schritte zum Reproduzieren?

Code: Select all

1. Update OneSignal to version 5.3.4
2. Use Flutter Version 3.29.2
3. Try to initialize OneSignal in main.dart
4.  Run the project in Android Production
---- Code ----

Code: Select all

void main() async {
WidgetsFlutterBinding.ensureInitialized();

if (Constants.isCrashlyticsEnabled) {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform);
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
}

OneSignal.initialize(Constants.onesignalAppID);

// some code that calls OneSignal.User.setLanguage()
// .... some other code

if (kDebugMode) {
OneSignal.Debug.setLogLevel(OSLogLevel.verbose);
}

// The promptForPushNotificationsWithUserResponse function will show the iOS or Android push notification prompt. We recommend removing the following code and instead using an In-App Message to prompt for notification permission
OneSignal.Notifications.requestPermission(false).then((accepted) {
Helper.talker.debug("Accepted permission: $accepted");
});

OneSignal.Notifications.addClickListener((openedResult) {
openedFromNotfication = true;
});

runApp(
ChangeNotifierProvider(
create: (context) => settingsProvider,
child: const MyApp(),
),
);
}
Was haben Sie erwartet?
OneSignal sollte initialisiert sein und wie im Debug-Modus einwandfrei funktionieren.
OneSignal Flutter SDK-Version
Release 3.29.2
Welche Plattform(en) sind betroffen?
  • [ ] iOS
  • [x] Android
Relevante Protokollausgabe

Code: Select all

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3.2 24D81 darwin-arm64, locale en-SA) [5.5s]
• Flutter version 3.29.2 on channel stable at /Users/myuser/fvm/versions/3.29.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c236373904 (8 months ago), 2025-03-13 16:17:06 -0400
• Engine revision 18b71d647a
• Dart version 3.7.2
• DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [10.0s]
• Android SDK at /Users/myuser/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime [url=viewtopic.php?t=25360]Environment[/url] (build 21.0.5+-12932927-b750.29)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [9.8s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web [45ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [41ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime [url=viewtopic.php?t=25360]Environment[/url] (build 21.0.5+-12932927-b750.29)

[✓] Connected device (4 available) [10.8s]
• FRL L22 (mobile)                • 8QCNW22629000690      • android-arm64  • Android 10 (API 29)
• macOS (desktop)                 • macos                 • darwin-arm64   • macOS 15.3.2 24D81 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 15.3.2 24D81 darwin-arm64
• Chrome (web)                    • chrome                • web-javascript • Google Chrome 142.0.7444.60
! Error: Browsing on the local area network for iPhone 15 Pro G. Ensure the device is unlocked and attached with a
cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for iPhone (650). Ensure the device is unlocked and attached with a cable
or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for iPhone.  Ensure the device is unlocked and attached with a cable or
associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [991ms]
• All expected network resources are available.

• No issues found!

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post