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

[Bug]: OneSignal 3.0.4 Android Notification Service Extension Not Working #539

Closed
1 task done
cinaradem opened this issue Oct 4, 2022 · 2 comments
Closed
1 task done

Comments

@cinaradem
Copy link

cinaradem commented Oct 4, 2022

What happened?

Hello,
The custom NotificationExtenderService service that I run in onesignal 2.x versions gives a build error after onesignal 3.x passes.
The build process cannot be completed because it does not see the onesignal packages when I checked.
Below is the details of the error.

Steps to reproduce?

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:6: error: cannot find symbol
import com.onesignal.OSNotificationDisplayedResult;
                    ^
  symbol:   class OSNotificationDisplayedResult
  location: package com.onesignal
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:7: error: cannot find symbol
import com.onesignal.NotificationExtenderService;
                    ^
  symbol:   class NotificationExtenderService
  location: package com.onesignal
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:8: error: cannot find symbol
import com.onesignal.OSNotificationReceivedResult;
                    ^
  symbol:   class OSNotificationReceivedResult
  location: package com.onesignal
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:17: error: cannot find symbol
public class NotificationServiceExtension extends NotificationExtenderService {
                                                  ^
  symbol: class NotificationExtenderService
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:19: error: cannot find symbol
    protected boolean onNotificationProcessing(final OSNotificationReceivedResult receivedResult) {
                                                     ^
  symbol:   class OSNotificationReceivedResult
  location: class NotificationServiceExtension
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:18: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:25: error: cannot find symbol
        final RemoteViews notificationSmallLayoutView = new RemoteViews(getPackageName(), R.layout.notification_small);
                                                                        ^
  symbol:   method getPackageName()
  location: class NotificationServiceExtension
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:26: error: cannot find symbol
        final RemoteViews notificationLargeLayoutView = new RemoteViews(getPackageName(), R.layout.notification_large);
                                                                        ^
  symbol:   method getPackageName()
  location: class NotificationServiceExtension
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:30: error: cannot find symbol
        OverrideSettings overrideSettings = new OverrideSettings();
        ^
  symbol:   class OverrideSettings
  location: class NotificationServiceExtension
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:30: error: cannot find symbol
        OverrideSettings overrideSettings = new OverrideSettings();
                                                ^
  symbol:   class OverrideSettings
  location: class NotificationServiceExtension
/Users/adem.cinar/Data/www/Dev360/Dev360.Slot.Unity/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/NotificationServiceExtension.java:74: error: cannot find symbol
        OSNotificationDisplayedResult displayedResult = displayNotification(overrideSettings);
        ^
  symbol:   class OSNotificationDisplayedResult
  location: class NotificationServiceExtension
11 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unityLibrary:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 18s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

What did you expect to happen?

Failed to generate apk output

Unity version

2021.3.9f1

OneSignal Unity SDK version

3.0.4

Platform

Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shepherd-l
Copy link
Contributor

Hello, thanks for reporting your issue.

The OneSignal package OSNotificationDisplayedResult you are using from the 2.x version of the OneSignal Unity SDK does not exist on version 3.x.

Please follow this migration guide and update your NotificationExtenderService: Step-by-Step Unity 2.x to 3.0.0 Upgrade Guide: Android - Background Notification Control


Let us know if you have any issues

@jkasten2
Copy link
Member

jkasten2 commented Mar 6, 2024

Closing due to no response

@jkasten2 jkasten2 closed this as completed Mar 6, 2024
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

3 participants