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]: share SDK for NSE? #214

Open
1 task done
Arthurdw opened this issue Dec 9, 2023 · 0 comments
Open
1 task done

[Bug]: share SDK for NSE? #214

Arthurdw opened this issue Dec 9, 2023 · 0 comments

Comments

@Arthurdw
Copy link

Arthurdw commented Dec 9, 2023

What happened?

Disclaimer: I'm new to RN

I tried to follow the guide from here:
https://documentation.onesignal.com/v9.0/docs/service-extensions#android-notification-extender-service

Steps to reproduce?

Created a repo here as demo purpose:
https://github.com/Arthurdw/demo-RN-onesignal-NSE-issue

Just run the `npx expo run:android`

What did you expect to happen?

It to be compiling

OneSignal Expo SDK version

I'm assuming this is 5.0.4

Platform

Android

Relevant log output

❯ npx expo run:android
(node:102963) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
› Building app...
Configuration on demand is an incubating feature.

> Configure project :expo

Using expo modules
  - expo-application (5.3.1)
  - expo-constants (14.4.2)
  - expo-file-system (15.4.5)
  - expo-font (11.4.0)
  - expo-keep-awake (12.3.0)
  - expo-modules-core (1.5.12)
  - expo-modules-core$android-annotation (1.5.12)
  - expo-modules-core$android-annotation-processor (1.5.12)
  - expo-splash-screen (0.20.5)


The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':expo', ':expo-modules-core'

> Task :app:compileDebugJavaWithJavac FAILED
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:7: error: cannot find symbol
import com.onesignal.OSNotification;
                    ^
  symbol:   class OSNotification
  location: package com.onesignal
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:8: error: cannot find symbol
import com.onesignal.OSMutableNotification;
                    ^
  symbol:   class OSMutableNotification
  location: package com.onesignal
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:9: error: cannot find symbol
import com.onesignal.OSNotificationReceivedEvent;
                    ^
  symbol:   class OSNotificationReceivedEvent
  location: package com.onesignal
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:10: error: cannot find symbol
import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler;
                              ^
  symbol:   class OSRemoteNotificationReceivedHandler
  location: class OneSignal
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:13: error: cannot find symbol
public class NotificationServiceExtension implements OSRemoteNotificationReceivedHandler {
                                                     ^
  symbol: class OSRemoteNotificationReceivedHandler
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:16: error: cannot find symbol
    public void remoteNotificationReceived(Context context, OSNotificationReceivedEvent notificationReceivedEvent) {
                                                            ^
  symbol:   class OSNotificationReceivedEvent
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:15: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:17: error: cannot find symbol
        OSNotification notification = notificationReceivedEvent.getNotification();
        ^
  symbol:   class OSNotification
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:20: error: cannot find symbol
        OSMutableNotification mutableNotification = notification.mutableCopy();
        ^
  symbol:   class OSMutableNotification
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:24: error: cannot find symbol
            builder.setColor(new BigInteger("FF00FF00", 16).intValue());
                                 ^
  symbol:   class BigInteger
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:26: error: cannot find symbol
            Spannable spannableTitle = new SpannableString(notification.getTitle());
            ^
  symbol:   class Spannable
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:26: error: cannot find symbol
            Spannable spannableTitle = new SpannableString(notification.getTitle());
                                           ^
  symbol:   class SpannableString
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:27: error: cannot find symbol
            spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
                                       ^
  symbol:   class ForegroundColorSpan
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:27: error: cannot find symbol
            spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
                                                           ^
  symbol:   variable Color
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:30: error: cannot find symbol
            Spannable spannableBody = new SpannableString(notification.getBody());
            ^
  symbol:   class Spannable
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:30: error: cannot find symbol
            Spannable spannableBody = new SpannableString(notification.getBody());
                                          ^
  symbol:   class SpannableString
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:31: error: cannot find symbol
            spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
                                      ^
  symbol:   class ForegroundColorSpan
  location: class NotificationServiceExtension
/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/app/src/main/java/com/anonymous/onesignalnseissue/NotificationServiceExtension.java:31: error: cannot find symbol
            spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
                                                          ^
  symbol:   variable Color
  location: class NotificationServiceExtension
18 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> 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 10s
143 actionable tasks: 3 executed, 140 up-to-date
Error: /home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/gradlew exited with non-zero code: 1
Error: /home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/android/gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (node:events:634:26)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at Object.spawnAsync [as default] (/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnGradleAsync (/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:72:46)
    at Object.assembleAsync (/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:52:18)
    at runAndroidAsync (/home/arthur/Documents/howest/ccett/demo-RN-onesignal-NSE-issue/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js:36:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

1 participant