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

Android crashes when receiving notifications. #590

Closed
WilliamAnputra opened this issue Jul 25, 2018 · 1 comment
Closed

Android crashes when receiving notifications. #590

WilliamAnputra opened this issue Jul 25, 2018 · 1 comment

Comments

@WilliamAnputra
Copy link

WilliamAnputra commented Jul 25, 2018

Description:

I am using one signal for my android app today, i have set up everything and i tried using the dashboard board to send me a message. The app crashes whenever it receives notification but message went through.
onesignal_message

Environment
One signal version : "^3.2.5"
How i install : npm install --save react-native-onesignal

Steps to reproduce:

  1. install one signal
  2. setup everything according to docs
  3. send message from one signal dashboard to test users

This is my app/build.gradle

dependencies {
compile project(':react-native-onesignal')
implementation project(':react-native-firebase')

implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
    transitive = true
}

compile project(':react-native-svg')

compile project(':react-native-push-notification')
compile('com.google.android.gms:play-services-gcm:15.0.1') {
    force = true;
}

implementation project(':react-native-vector-icons')
compile project(':react-native-fbsdk')

implementation(project(':react-native-google-signin')) {
    exclude group: "com.google.android.gms"
}
implementation project(':react-native-splash-screen')

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:23.0.1"
implementation "com.facebook.react:react-native:+"  // From node_modules

implementation(project(':react-native-maps')) {
    exclude group: 'com.google.android.gms', module: 'play-services-base'
    exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'

implementation(project(":react-native-google-signin")) {
    exclude group: "com.google.android.gms" // very important
}

implementation 'com.google.android.gms:play-services-auth:15.0.1'

}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: "com.android.application"
apply plugin: "io.fabric"

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

This is my crash stacktrace:

07-25 16:31:06.253 9371-9371/com.instantpark E/AndroidRuntime: FATAL EXCEPTION: main Process: com.instantpark, PID: 9371 java.lang.NoSuchMethodError: No static method zzad()Lcom/google/firebase/iid/zzan; in class Lcom/google/firebase/iid/zzan; or its super classes (declaration of 'com.google.firebase.iid.zzan' appears in /data/app/com.instantpark-30SSLbAs-W25EJfn2GWZDg==/base.apk) at com.google.firebase.messaging.FirebaseMessagingService.zzb(Unknown Source:0) at com.google.firebase.iid.zzb.onStartCommand(Unknown Source:12) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3488) at android.app.ActivityThread.-wrap20(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:172) at android.app.ActivityThread.main(ActivityThread.java:6590) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

@WilliamAnputra
Copy link
Author

I solved this by adding firebase messaging see OneSignal/OneSignal-Android-SDK#592 for more detail

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

1 participant