Closed capitaljmedia closed 2 years ago
@capitaljmedia Thanks for reporting, this "OneSignal Could not find the Android Support Library" could happen due to a number of different things. Could you double check all the steps in "Step 5. Android Setup", make sure none of the steps were missed and they match as this cause this issue.
If you still see the problem could you list the Unity version you are using and well as all the other Android SDKs / libraries in your project as well as their versions?
Lastly we have a beta version of a 3.0.0 OneSignal SDK you can try which has newer dependencies which might solve this issue as well. See the migration guide below: https://documentation.onesignal.com/docs/step-by-step-unity-2x-to-300-update-guide
Thank you for the additional help. Yes we tried the 3 beta but couldn't get that to build with our unity version, but perhaps we didn't understand the setup instructions as there were some code errors. We are using unity 2021.2.7.
We were able to get the Library error to go away by checking Custom Gradle Properties Template, and the android device is now registered however it does not receive notifications still. In the onesignal dashboard it shows the message as delivered to the device. We've tried deleting the app and checking that it has notification permission.
@capitaljmedia Thanks for the update. I split my reply into the 3 different sections to cover the topics we have been discussing here:
In the 3.0.0 release of the OneSignal Unity SDK, Android dependencies are now configured automatically during installation. This means you no longer need the "Custom Gradle Properties Template" for OneSignal, however you may still keep it if you need it for anything else in your project.
Could you provide the build errors you had with the beta? There is a good chance that these errors have been fixed in the final 3.0.0 release. If are still seeing compile errors after following the Step-by-Step Unity 2.x to 3.0.0 Upgrade Guide double check you haven't missed any steps when updating your code. Please provide the exact errors and steps to reproduce if you continue to see the same issue or any other issues. Include your Unity version as well if it is not still 2021.2.7
.
I am not sure why notifications are not being received for you on the 2.x.x version of OneSignal you are using. However I recommend moving forward to the OneSignal 3.0.0 version as this may be addressed as well.
We tried again to upgrade to version 3 and were able to get the android notifications to work but now the iOS ones have stopped working. We also get this build error if we try to "Append" the xcode project rather than "Replace" it: Error building Player: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
So if we choose replace (which is more time consuming) the build works. Then ofcourse we have to also setup the signing again in Xcode.. why is onesignal integration so painful :)
However notifications no longer work (on iOS), but it's not clear whether that has to do with the upgrade to 3 or some other issue. We do see this message:
2022-04-06 15:25:21.796076-0300 Bonju[343:5305] VERBOSE: setAppId(id) called with appId:
2022-04-06 15:25:21.796105-0300 Bonju[343:5305] VERBOSE: setAppId(id) finished, checking if launchOptions has been set before proceeding...!
2022-04-06 15:25:21.796127-0300 Bonju[343:5305] WARNING: appId set, but please call setLaunchOptions(launchOptions) to complete OneSignal init!
2022-04-06 15:25:21.796144-0300 Bonju[343:5305] VERBOSE: setLaunchOptions() called with launchOptions: (null)!
2022-04-06 15:25:21.796160-0300 Bonju[343:5305] VERBOSE: setLaunchOptions(id) finished, checking if appId has been set before proceeding...!
2022-04-06 15:25:21.796178-0300 Bonju[343:5305] VERBOSE: setLaunchOptions(launchOptions) successful and appId is set, initializing OneSignal...
2022-04-06 15:25:21.796311-0300 Bonju[343:5305] VERBOSE: Delayed initialization of the OneSignal SDK until the user provides privacy consent using the consentGranted() method
2022-04-06 15:25:21.797275-0300 Bonju[343:5305] WARNING: Your application has called promptForPushNotificationsWithUserResponse: before the user granted privacy permission. Please call consentGranted(bool)
in order to provide user privacy consent
2022-04-06 15:25:21.965189-0300 Bonju[343:5570] fopen failed for data file: errno = 2 (No such file or directory)
2022-04-06 15:25:21.965217-0300 Bonju[343:5570] Errors found! Invalidating cache...
2022-04-06 15:25:22.304781-0300 Bonju[343:5305] Unbalanced calls to begin/end appearance transitions for <UnityDefaultViewController: 0x100ba3dd0>.
Based on the log you have set enabled "Require User Consent" on the OneSignalBehavior or have OneSignal.Default.RequiresPrivacyConsent = true;
in your code.
2022-04-06 15:25:21.796311-0300 Bonju[343:5305] VERBOSE: Delayed initialization of the OneSignal SDK until the user provides privacy consent using the consentGranted() method
2022-04-06 15:25:21.797275-0300 Bonju[343:5305] WARNING: Your application has called promptForPushNotificationsWithUserResponse: before the user granted privacy permission. Please call consentGranted(bool) in order to provide user privacy consent
If you didn't intend to do that remove the code or uncheck this box on the component. It effects both Android and iOS so maybe you changed it by mistake after testing Android.
I have not been able to reproduce any errors related to Unity's Append build option.
Error building Player: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
This may be related to issue #468, I recommend you comment there and provide the full error you are seeing
For the iOS error I recommend making sure you have CocoaPods 1.11.3 installed on your macOS system, older versions may get an error.
If you are still seeing an issue with registering on Android I recommend opening a new issue, since this is different than the orignal issue.
Description:
I've just started using onesignal for push notifications in Unity. My iOS build works correctly and receives push, but on android my user is subscribed but has a missing library error: OneSignal Could not find the Android Support Library. Please make sure it has been correctly added to your project.
I have tried the troubleshooting "force resolve" of the android resolver, but it didn't help. I have also checked the project to see if there is an older Play Services Resolver in the project but we don't have that either.
Environment
Steps to Reproduce Issue:
Anything else:
(crash stacktraces, as well as any other information here) OneSignal Could not find the Android Support Library. Please make sure it has been correctly added to your project.