说明:
我今天正在为我的android应用程序使用一个信号,我已经设置了所有内容,并且尝试使用仪表板向我发送消息。每当收到通知但消息通过时,应用程序就会崩溃。 onesignal_message
环境:
一个信号版本:“ ^ 3.2.5”
我如何安装:npm install --save react-native-onesignal
复制步骤:
1。安装一个信号
2。根据文档设置所有内容
这是我的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
这是我的崩溃堆栈跟踪:
07-25 16:31:06.253 9371-9371 / com.instantpark E / AndroidRuntime:致命例外:主进程:com.instantpark,PID:9371 java.lang.NoSuchMethodError:无静态方法zzad()Lcom / google / firebase / iid / zzan;在Lcom / google / firebase / iid / zzan类中;或其超级类(对“ com.google.firebase.iid.zzan的声明”显示在com.google.firebase.messaging.FirebaseMessagingService的/data/app/com.instantpark-30SSLbAs-W25EJfn2GWZDg==/base.apk中)。 com.google.firebase.iid.zzb.onStartCommand上的zzb(未知来源:0),android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3488)处android.app.ActivityThread.-wrap20( android.os.Looper.loop(Looper.java :)上android.os.Handler.dispatchMessage(Handler.java:106)上android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1704)的未知来源:0): 172)在android.app.ActivityThread.main(ActivityThread.java:6590)在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java: 438),位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)