I am using react native 0.62.2 and notifee 0.11.0. Android build is failing with the error PackageList.java:20 error: package io.invertase.notifee does not exist. Can anyone help on this?
Hi @ashokkumar88 I was using 0.62.2 with that version and it worked, now I'm on react-native 0.63.x and it is still working, I suspect this is a project-level integration issue. At any rate, we're on 0.11.1 now, can you upgrade to that version and perhaps try de-integrating and re-integrating it in your project following the docs? Or if that is still unsuccessful if you could post a quick example (start with npx react-native init) in a fresh public repo on github and if we can see the problem we can solve it.
Hi @mikehardy Yes it is working with a new fresh project. Might be another library conflicting. I will check. Thanks
Thanks for following up @ashokkumar88 - I'm going to close this as it seems there is no action to take here but of course if you discover some new information that brings it back to this module we can reopen and collaborate. Good luck with your project!
@ashokkumar88 how did you slove this issue. Which library was conflicting with your project.
@burhanDebug The issue was causing due to the multidex option. I whitelisted the notifee classes to add it in the primary dex by adding a multiDexKeepFile option in the app build.gradle file and the issue resolved. You can read the reference here https://developer.android.com/studio/build/multidex#keep
@ashokkumar88 could you please add these chunks of code there i am unable to configure that. I will be thankful to you for this favour.
That is an unexpected result, to me. The MultiDex items are all runtime solutions for java.lang.NoClassDefFoundError - a compile error where a package is not found should have nothing to do with multidex.
It is possible that in MultiDex cases you would need to do something for Notifee to work, but then the symptom would be "I see java.lang.NoClassDefFoundError on Android devices < API21" not "I have a compile failure" :thinking:
Moreover, this library already handles MultiDex and Proguard: https://github.com/notifee/react-native-notifee/blob/master/android/proguard-rules.pro
I use it successfully with a minSdkVersion 16 app that I test regularly on old devices.
@mikehardy You are correct. I was getting `java.lang.NoClassDefFoundError' and not build failed. I mistakenly mentioned the multidex solution above. @burhanDebug Actually my build was failing due to the Onesignal gradle plugin mentioned in their documentation. After removing this plugin the build was successful.
@ashokkumar88 Thanks man you made my problem solve. The problem is conflicting with onesignal gradle settings with notifee.
My library is configured but i am stuck in another .aar issue.
Let me give it a try to solve it.
@mikehardy notifee library is having some issues with onesignal settings.
Or one signal is having issues with notifee 馃槈, I say that because I'm not sure what they are doing but we are doing everything according to Android docs so I do not have any ideas on what to even look for to change
Might be because the OneSignal SDK is not yet upgraded to AndroidX.
What in the world? That's unexpected! That's on them, it is about a year past time to do that. I mean, if react-native can do it - as a loose group of volunteers with modules all over and uncoordinated releases - last year via jetifier, one signal has to figure that out. Even with that said, it should be possible to use one signal via jetifier, I'm thinking.
Yes, currently we are using onesignal via jetifier only.
If anyone still want to use the onesignal with notifee then you need to modify the following in onesignal library.
node_modules/react-native-onesignal/android/build.gradleIn the android dependencies modify the api ('com.onesignal:OneSignal:3.15.1') to
api ('com.onesignal:OneSignal:3.15.1') {
exclude group: 'com.google.android.gms', module: 'play-services-location'
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-ads-identifier'
exclude group: 'com.google.firebase', module: 'firebase-messaging'
}
@ashokkumar88 that is excellent! Thank you, I'll update our documentation here.
I highly recommend https://github.com/ds300/patch-package to anyone reading this that does not know about it. It allows you to make changes like this very safely - managed by source control and with warnings if onesignal plugin has a new version - it makes changes like this easy
Changed here - working on getting them out to the live site now, thanks for helping figure this out! https://github.com/notifee/documentation/commit/7249b1d497b7dac9765677642aae970c09cb93b7
Great! Glad to be help of.