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

OneSignal Not Initializing [Bug]: com.amazon.device.iap.internal.d #709

Closed
2 of 3 tasks
jabirmayar opened this issue Aug 20, 2023 · 43 comments
Closed
2 of 3 tasks

OneSignal Not Initializing [Bug]: com.amazon.device.iap.internal.d #709

jabirmayar opened this issue Aug 20, 2023 · 43 comments

Comments

@jabirmayar
Copy link

jabirmayar commented Aug 20, 2023

What happened?

i have in main function
` OneSignal.Debug.setLogLevel(OSLogLevel.fatal);

OneSignal.initialize("appid");

OneSignal.Notifications.requestPermission(true);`

Steps to reproduce?

Add the latest version of package. 
Initialize onesignal
run app

What did you expect to happen?

For appsignal to initialize and login user external id

OneSignal Flutter SDK version

5.0.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

`/MethodChannel#OneSignal( 3124): Failed to handle method call
E/MethodChannel#OneSignal( 3124): java.lang.IllegalArgumentException: Expected receiver of type com.amazon.device.iap.internal.d, but got kotlin.Unit
E/MethodChannel#OneSignal( 3124): 	at java.lang.reflect.Field.get(Native Method)
E/MethodChannel#OneSignal( 3124): 	at com.onesignal.core.internal.purchases.impl.TrackAmazonPurchase.start(TrackAmazonPurchase.kt:83)
E/MethodChannel#OneSignal( 3124): 	at com.onesignal.core.internal.startup.StartupService.start(StartupService.kt:16)
E/MethodChannel#OneSignal( 3124): 	at com.onesignal.internal.OneSignalImp.initWithContext(OneSignalImp.kt:247)
E/MethodChannel#OneSignal( 3124): 	at com.onesignal.OneSignal.initWithContext(OneSignal.kt:126)
E/MethodChannel#OneSignal( 3124): 	at com.onesignal.flutter.OneSignalPlugin.initWithContext(OneSignalPlugin.java:128)
E/MethodChannel#OneSignal( 3124): 	at com.onesignal.flutter.OneSignalPlugin.onMethodCall(OneSignalPlugin.java:111)
E/MethodChannel#OneSignal( 3124): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#OneSignal( 3124): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#OneSignal( 3124): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#OneSignal( 3124): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#OneSignal( 3124): 	at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#OneSignal( 3124): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#OneSignal( 3124): 	at android.os.Looper.loop(Looper.java:268)
E/MethodChannel#OneSignal( 3124): 	at android.app.ActivityThread.main(ActivityThread.java:8019)
E/MethodChannel#OneSignal( 3124): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#OneSignal( 3124): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
E/MethodChannel#OneSignal( 3124): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
I/System.out( 3124): [okhttp]:check permission begin!
I/System.out( 3124): [okhttp]:not MMS!
I/System.out( 3124): [okhttp]:not Email!
/flutter ( 3124): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
E/flutter ( 3124): )
E/flutter ( 3124): #0      StandardMethodCodec.decodeEnvelope
message_codecs.dart:652
E/flutter ( 3124): #1      MethodChannel._invokeMethod
platform_channel.dart:310
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124):
E/flutter ( 3124): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#lifecycleInit on channel OneSignal#inappmessages)
E/flutter ( 3124): #0      MethodChannel._invokeMethod
platform_channel.dart:308
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124): #1      OneSignalInAppMessages.lifecycleInit
inappmessages.dart:77
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124):
E/flutter ( 3124): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#pushSubscriptionToken on channel OneSignal#pushsubscription)
E/flutter ( 3124): #0      MethodChannel._invokeMethod
platform_channel.dart:308
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124): #1      OneSignalPushSubscription.lifecycleInit
pushsubscription.dart:65
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124):
E/flutter ( 3124): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#permission on channel OneSignal#notifications)
E/flutter ( 3124): #0      MethodChannel._invokeMethod
platform_channel.dart:308
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124): #1      OneSignalNotifications.lifecycleInit
notifications.dart:121
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124):
E/flutter ( 3124): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#requestPermission on channel OneSignal#notifications)
E/flutter ( 3124): #0      MethodChannel._invokeMethod
platform_channel.dart:308
E/flutter ( 3124): <asynchronous suspension>
E/flutter ( 3124): #1      OneSignalNotifications.requestPermission
notifications.dart:91
E/flutter ( 3124): <asynchronous suspension>`

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ghost
Copy link

ghost commented Aug 23, 2023

same issue

@KostyaLocal
Copy link

Same issue on MIUI on real device

@MobIS1User
Copy link

same issue for us

@Aboneyx
Copy link

Aboneyx commented Aug 26, 2023

same issue

@Chhay67
Copy link

Chhay67 commented Aug 28, 2023

same issue. any solution ????

@Aboneyx
Copy link

Aboneyx commented Aug 28, 2023

same issue. any solution ????

rolled back to version 3.5.1

@kerjakuyco
Copy link

Same issue here, seems like no clear solution right now beside rolling back to previous version

@KostyaLocal
Copy link

KostyaLocal commented Aug 28, 2023

Same issue here, seems like no clear solution right now beside rolling back to previous version

I've rolled back too. Now I have problems with OneSignal.shared.setExternalUserId , OneSignal.shared.setEmail, OneSignal.shared.removeExternalUserId. They just take a long time to call

OneSignal is so buggy, are there any alternatives with full Flutter support?

@metalwings
Copy link

metalwings commented Aug 29, 2023

Same issue here.
Version 5.0.0 works on iOS but causes android to crash.

Downgrading to https://pub.dev/packages/onesignal_flutter/versions/3.5.1 works for now.

@jabirmayar
Copy link
Author

3.5.1 works, yes. but I would really like to use the latest as I already changed everything and i don't want to rollback. So I guess will have to wait for a fix.

@kryptamine
Copy link

same issue here

@khurramaleee
Copy link

Same issue crashing in release mode

@jblankenship5
Copy link

Updated all my code to new version just to have to rollback Zzz..

@emawby
Copy link
Contributor

emawby commented Sep 5, 2023

Thank you for reporting this is likely a "minify" issue with the Android native SDK. The fix should be available soon thank you for your patience!

@abudawud
Copy link

same issue when running the app on release mode flutter run --release.
but it's work fine on debug mode flutter run

@rafael-mq
Copy link

Check this answer on another issue: #725 (comment)

@MaximilianFlechtner
Copy link

+1

@giovanni256
Copy link

Check this answer on another issue: #725 (comment)

Not working for this issue, +1

@emawby
Copy link
Contributor

emawby commented Sep 22, 2023

Thank you for reporting we are working on a fix for this asap!

@sharprockventures
Copy link

Thanks @emawby! I am having the same issue and just found this thread. Glad you guys are working on it!

@akanxa
Copy link

akanxa commented Sep 25, 2023

same issue any solution?

@talkbiz
Copy link

talkbiz commented Sep 25, 2023

Same issue

@acvxx
Copy link

acvxx commented Sep 25, 2023

same issue

@KodyKendall
Copy link

Is there a short term workaround? I am running into this issue for the react-native SDK as well.

@akanxa
Copy link

akanxa commented Sep 29, 2023

same issue

@tuantung
Copy link

tuantung commented Oct 2, 2023

Same issue. iOS works fine. Only crashes with Android

@nan-li
Copy link
Contributor

nan-li commented Oct 3, 2023

Hi everyone,

Can you let me know if you are using any other in-app purchasing or purchases-related SDK in your app?
And if you use Amazon IAP SDK?

@akanxa
Copy link

akanxa commented Oct 3, 2023

Hi @nan-li, I used purchases_flutter, and it is working well after commenting this library.

@MobIS1User
Copy link

Hi everyone,

Can you let me know if you are using any other in-app purchasing or purchases-related SDK in your app? And if you use Amazon IAP SDK?

We do not use any of those things in our Flutter app. Thanks for looking into it!

@jabirmayar
Copy link
Author

Hi everyone,

Can you let me know if you are using any other in-app purchasing or purchases-related SDK in your app? And if you use Amazon IAP SDK?

I am using purchases_flutter from RevenueCat. I will look into if this is what causing the issue.

@nan-li
Copy link
Contributor

nan-li commented Oct 3, 2023

Hi @akanxa, the OneSignal SDK works successfully if you remove purchases_flutter?

This is helpful information to help us resolve this bug.

@harryt2
Copy link

harryt2 commented Oct 4, 2023

Possibly related: after removing RevenueCat's sdk mine started working again. Using Ionic Vue Capacitor and the Cordova plugin.

@Klyado
Copy link

Klyado commented Oct 4, 2023

Same here with RevenueCat installed. It causes issues and breaks everything.
I'm using Expo SDK but I guess that's the same problem.

@acvxx
Copy link

acvxx commented Oct 4, 2023

Hi everyone,

Can you let me know if you are using any other in-app purchasing or purchases-related SDK in your app? And if you use Amazon IAP SDK?

I'm using both the "in_app_purchase" package and the "purchases_flutter" package.
OneSignal SDK started working correctly after I removed the "purchases_flutter" package from RevenueCat.

@akanxa
Copy link

akanxa commented Oct 5, 2023

Hi @akanxa, the OneSignal SDK works successfully if you remove purchases_flutter?

This is helpful information to help us resolve this bug.

Hi @akanxa, the OneSignal SDK works successfully if you remove purchases_flutter?

This is helpful information to help us resolve this bug.

Yes it perfectly working after removing 'purchase_flutter'

@vegaro
Copy link

vegaro commented Oct 5, 2023

I work at purchases-flutter. I've been looking into this, and I believe the issue is in this line https://github.com/OneSignal/OneSignal-Android-SDK/blob/5.0.2/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/purchases/impl/TrackAmazonPurchase.kt#L77.

Method e changed in version 3.0.4 of the Amazon SDK (see https://www.diffchecker.com/mAggUTRG/ )

In 3.0.4

public boolean e() {
        this.h();
        return com.amazon.a.a.a((Application)this.e.getApplicationContext());
}

In 3.0.1, 3.0.2, 3.0.3

public static d e() {
        return c;
 }

purchases-flutter depends on version 3.0.3 of the Amazon Appstore SDK, and it looks like OneSignal-Android compiles against the latest available (3.0.4), so maybe that's where the issue is? That the function is not the same as the one in runtime?

@nan-li
Copy link
Contributor

nan-li commented Oct 5, 2023

Hi everyone, thanks for your reports.

We identified the bug in our native Android SDK's code and the fix will be included in the next release.

Thanks @vegaro for pointing out that the appstore v3.0.4 has a method name change. This wasn't the bug we needed to fix, but we used this information to make the SDK now compatible with v3.0.4.

@Klyado
Copy link

Klyado commented Oct 6, 2023

Hi @nan-li thanks for the good news (and @vegaro for taking a look at it).
When will the new version be released?
I guess you'll also update the Expo SDK as it also contains the issue?

Thanks again!

@nan-li
Copy link
Contributor

nan-li commented Oct 7, 2023

Hi everyone, thanks for your patience.

We released the fix in the latest release of the OneSignal Flutter SDK, please see version 5.0.3.

Please let us know if you have any remaining issues.

@nan-li nan-li closed this as completed Oct 7, 2023
@michael-joseph-payne
Copy link

image

Still present in 5.0.3

@nan-li
Copy link
Contributor

nan-li commented Oct 23, 2023

Hi @michael-joseph-payne,

I cannot tell what the logs show. Is it a crash? Is it a "method not found" error? Is it an log from OneSignal or is it a log from Amazon Appstore SDK?

The crash users reported is java.lang.IllegalArgumentException: Expected receiver of type com.amazon.device.iap.internal.d, but got kotlin.Unit which has been fixed in 5.0.3.

@burakcbdn
Copy link

burakcbdn commented Dec 6, 2023

still gettiing this error on 5.0.4

E/DartMessenger(28499): Uncaught exception in binary message listener
E/DartMessenger(28499): java.lang.Exception: Must call 'initWithContext' before use
E/DartMessenger(28499): 	at com.onesignal.internal.OneSignalImp.getNotifications(OneSignalImp.kt:91)
E/DartMessenger(28499): 	at com.onesignal.OneSignal.getNotifications(OneSignal.kt:62)
E/DartMessenger(28499): 	at com.onesignal.flutter.OneSignalNotifications.registerClickListener(OneSignalNotifications.java:195)
E/DartMessenger(28499): 	at com.onesignal.flutter.OneSignalNotifications.onMethodCall(OneSignalNotifications.java:74)
E/DartMessenger(28499): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/DartMessenger(28499): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/DartMessenger(28499): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/DartMessenger(28499): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/DartMessenger(28499): 	at android.os.Handler.handleCallback(Handler.java:938)
E/DartMessenger(28499): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/DartMessenger(28499): 	at android.os.Looper.loop(Looper.java:246)
E/DartMessenger(28499): 	at android.app.ActivityThread.main(ActivityThread.java:8653)
E/DartMessenger(28499): 	at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(28499): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/DartMessenger(28499): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

@nan-li nan-li changed the title OneSignal Not Initializing [Bug]: OneSignal Not Initializing [Bug]: com.amazon.device.iap.internal.d Feb 1, 2024
@LiLatee
Copy link

LiLatee commented Jul 24, 2024

Hi!
I am also receiving that issue on Android using package version 5.2.2
We also use in-app purchase packages in the project.

  in_app_purchase: ^3.1.13
  in_app_purchase_android: any
  in_app_purchase_platform_interface: any
  in_app_purchase_storekit: any
  in_app_review: ^2.0.9
E/DartMessenger(10972): Uncaught exception in binary message listener
E/DartMessenger(10972): java.lang.Exception: Must call 'initWithContext' before use
E/DartMessenger(10972): 	at com.onesignal.internal.OneSignalImp.getUser(OneSignalImp.kt:119)
E/DartMessenger(10972): 	at com.onesignal.OneSignal.getUser(OneSignal.kt:46)
E/DartMessenger(10972): 	at com.onesignal.flutter.OneSignalUser.setLanguage(OneSignalUser.java:70)
E/DartMessenger(10972): 	at com.onesignal.flutter.OneSignalUser.onMethodCall(OneSignalUser.java:36)
E/DartMessenger(10972): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/DartMessenger(10972): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/DartMessenger(10972): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/DartMessenger(10972): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/DartMessenger(10972): 	at android.os.Handler.handleCallback(Handler.java:958)
E/DartMessenger(10972): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/DartMessenger(10972): 	at android.os.Looper.loopOnce(Looper.java:205)
E/DartMessenger(10972): 	at android.os.Looper.loop(Looper.java:294)
E/DartMessenger(10972): 	at android.app.ActivityThread.main(ActivityThread.java:8177)
E/DartMessenger(10972): 	at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(10972): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/DartMessenger(10972): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

EDIT: Sorry wrong issue. I had to init OneSignal before calling setLanguage.

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