Notification issue in Android 6.0
Hello, I am getting issue in 6.0 while getting notification, my app is stopped can you please tell me whats the issue? The logs are describe below:
No pending exception expected: java.lang.NoClassDefFoundError: com.onesignal.JobIntentService$JobServiceEngineImpl
at java.lang.Class dalvik.system.DexFile.defineClassNative(java.lang.String, java.lang.ClassLoader, java.lang.Object) (DexFile.java:-2)
at java.lang.Class dalvik.system.DexFile.defineClass(java.lang.String, java.lang.ClassLoader, java.lang.Object, java.util.List) (DexFile.java:226)
at java.lang.Class dalvik.system.DexFile.loadClassBinaryName(java.lang.String, java.lang.ClassLoader, java.util.List) (DexFile.java:219)
@AliBadar Is there any other log entires before or after this? I don't believe the entries you added would result in a crash.
@jkasten2 The app does not crashed, it just freezes the application for few seconds and it happens only when i have to receive the push notification, The app is freezes and i didn't receive any push notification., This issue is coming in only 6.0 Marshmallow devices whereas its working fine on 7.0, 8.0 and previous versions of 6.0 also.
@jkasten2 The logs are below:
No pending exception expected: java.lang.NoClassDefFoundError: com.onesignal.JobIntentService$JobServiceEngineImpl
at java.lang.Class dalvik.system.DexFile.defineClassNative(java.lang.String, java.lang.ClassLoader, java.lang.Object) (DexFile.java:-2)
at java.lang.Class dalvik.system.DexFile.defineClass(java.lang.String, java.lang.ClassLoader, java.lang.Object, java.util.List) (DexFile.java:226)
at java.lang.Class dalvik.system.DexFile.loadClassBinaryName(java.lang.String, java.lang.ClassLoader, java.util.List) (DexFile.java:219)
at java.lang.Class dalvik.system.DexPathList.findClass(java.lang.String, java.util.List) (DexPathList.java:338)
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:54)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
at android.content.Intent com.onesignal.NotificationExtenderService.getIntent(android.content.Context) (NotificationExtenderService.java:208)
at boolean com.onesignal.NotificationBundleProcessor.startExtenderService(android.content.Context, android.os.Bundle, com.onesignal.NotificationBundleProcessor$ProcessedBundleResult) (NotificationBundleProcessor.java:460)
at com.onesignal.NotificationBundleProcessor$ProcessedBundleResult com.onesignal.NotificationBundleProcessor.processBundleFromReceiver(android.content.Context, android.os.Bundle) (NotificationBundleProcessor.java:434)
at com.onesignal.NotificationBundleProcessor$ProcessedBundleResult com.onesignal.GcmBroadcastReceiver.processOrderBroadcast(android.content.Context, android.content.Intent, android.os.Bundle) (GcmBroadcastReceiver.java:110)
at void com.onesignal.GcmBroadcastReceiver.onReceive(android.content.Context, android.content.Intent) (GcmBroadcastReceiver.java:67)
at void android.app.ActivityThread.handleReceiver(android.app.ActivityThread$ReceiverData) (ActivityThread.java:3634)
at void android.app.ActivityThread.access$2000(android.app.ActivityThread, android.app.ActivityThread$ReceiverData) (ActivityThread.java:221)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1876)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:158)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7224)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1230)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1120)
A/art: art/runtime/thread.cc:1337]
art/runtime/runtime.cc:368] Runtime aborting...
A/art: art/runtime/runtime.cc:368]
D/libEGL: eglTerminate EGLDisplay = 0xbec913a4
A/google-breakpad: Microdump skipped (uninteresting)
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad: Chrome build fingerprint:
W/google-breakpad: 1.7
W/google-breakpad: 8
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 2293 (com.example.app)
A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
A/DEBUG: Build fingerprint: 'samsung/kltexx/klte:6.0.1/MMB29M/G900FXXU1CPL7:user/release-keys'
A/DEBUG: Revision: '14'
A/DEBUG: ABI: 'arm'
A/DEBUG: pid: 2293, tid: 2293, name: com.example.app >>> com.example.app <<<
This is my gradle file:
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
manifestPlaceholders = [onesignal_app_id: "123-123-123-123-123",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 16
targetSdkVersion 26
versionCode 8
versionName "1.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true;
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [onesignal_app_id: "f9c5ef97-9f57-4862-883a-c3a4f791ac11",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:
compile 'com.android.support:design:26.1.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services-gcm:+'
compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
compile 'com.google.firebase:firebase-ads:9.0.0'
}
@AliBadar Thanks for the details, a signal 6 is normally sent when the app is not responding on the main thread as you noted. Normally there is an ANR prompt and report as well? Do you get an ANR in either case?
Do you have any other code handling FCM / GCM messages outside of OneSignal? Could you try our example project to see if you still have the issue with that device? https://github.com/OneSignal/OneSignal-Android-SDK/tree/master/Examples/AndroidStudio
Lastly I don't think the java.lang.NoClassDefFoundError error with com.onesignal.JobIntentService$JobServiceEngineImpl is the root of this issue. Can you provide a full logcat from the device with time stamps and pids enabled? See this guide on getting this.
https://documentation.onesignal.com/docs/troubleshooting-android#section-how-to-get-a-crash-or-error-log-from-an-android-device
If you don't want to make this log public you an send this to OneSignal support linking them this thread.
@jkasten2 I am not getting any report, my app is struck and phone hangs for few seconds in 6.0 when i have to receive the notification, its working fine on other versions of android. The logs are as below:
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] No pending exception expected: java.lang.NoClassDefFoundError: com.onesignal.JobIntentService$JobServiceEngineImpl
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class dalvik.system.DexFile.defineClassNative(java.lang.String, java.lang.ClassLoader, java.lang.Object) (DexFile.java:-2)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class dalvik.system.DexFile.defineClass(java.lang.String, java.lang.ClassLoader, java.lang.Object, java.util.List) (DexFile.java:226)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class dalvik.system.DexFile.loadClassBinaryName(java.lang.String, java.lang.ClassLoader, java.util.List) (DexFile.java:219)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class dalvik.system.DexPathList.findClass(java.lang.String, java.util.List) (DexPathList.java:338)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:54)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at android.content.Intent com.onesignal.NotificationExtenderService.getIntent(android.content.Context) (NotificationExtenderService.java:208)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at boolean com.onesignal.NotificationBundleProcessor.startExtenderService(android.content.Context, android.os.Bundle, com.onesignal.NotificationBundleProcessor$ProcessedBundleResult) (NotificationBundleProcessor.java:460)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at com.onesignal.NotificationBundleProcessor$ProcessedBundleResult com.onesignal.NotificationBundleProcessor.processBundleFromReceiver(android.content.Context, android.os.Bundle) (NotificationBundleProcessor.java:434)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at com.onesignal.NotificationBundleProcessor$ProcessedBundleResult com.onesignal.GcmBroadcastReceiver.processOrderBroadcast(android.content.Context, android.content.Intent, android.os.Bundle) (GcmBroadcastReceiver.java:110)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void com.onesignal.GcmBroadcastReceiver.onReceive(android.content.Context, android.content.Intent) (GcmBroadcastReceiver.java:67)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void android.app.ActivityThread.handleReceiver(android.app.ActivityThread$ReceiverData) (ActivityThread.java:2732)
02-21 22:09:53.713 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void android.app.ActivityThread.access$1800(android.app.ActivityThread, android.app.ActivityThread$ReceiverData) (ActivityThread.java:153)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1428)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void android.os.Looper.loop() (Looper.java:148)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5442)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:738)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336] at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:628)
02-21 22:09:53.714 7775-7775/com.example.app A/art: art/runtime/thread.cc:1336]
02-21 22:09:55.791 7775-7775/com.example.app A/art: art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
02-21 22:09:55.791 7775-7775/com.example.app A/art: art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
02-21 22:09:55.791 7775-7775/com.example.app A/art: art/runtime/runtime.cc:366]
@AliBadar Are you getting any other errors or warnings before this line in your logcat?
No pending exception expected: java.lang.NoClassDefFoundError: com.onesignal.JobIntentService$JobServiceEngineImpl
Are you seeing this same issue on our example project?
Can you try another Android 6.0 device such as an emulator?
Does disabling multiDexEnabled fix the issue for you?
Thanks.
@jkasten2 The issue is solved now i am getting notifications on 6.0. Thanks.
i have same issue, how to fix it?
Android Marshmallow one signal notification not working for Vibe lenovo device 6.0