react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

[Bug]: NSInvalidUnarchiveOperationException.

Open techday84 opened this issue 2 years ago • 2 comments

What happened?

*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (OSIndirectNotification) for key (NS.objects) because no class named "OSIndirectNotification" was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target). If the class was renamed, use setClassName:forClass: to add a class translation mapping to NSKeyedUnarchiver.

`"react-native-onesignal": "^4.5.1".

build.gradle configuration:

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 24
        compileSdkVersion = 33
        targetSdkVersion = 33
        kotlin_version = '1.7.10'
        androidXBrowser = "1.4.0" // Adding this property will avoid defaultAndroidXVersion

        if (System.properties['os.arch'] == "aarch64") {
            // For M1 Users we need to use the NDK 24 which added support for aarch64
            ndkVersion = "24.0.8215888"
        } else {
            // Otherwise we default to the side-by-side NDK version from AGP.
            ndkVersion = "21.4.7075529"
        }
    }
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        jcenter()
        maven { url "https://jitpack.io" }
    }
    dependencies {

        classpath('com.android.tools.build:gradle:7.2.2')
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("de.undercouch:gradle-download-task:5.0.1")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        //onesignal
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'

        classpath 'com.google.gms:google-services:4.3.13'
        //Firebase crashlytics
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"


    }
}

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()

    }
}

### Steps to reproduce?

```Markdown
1.- Create a new react native project "react-native": "0.70.6"
2.- Install react-native-onesignal version "react-native-onesignal": "^4.5.1"

What did you expect to happen?

I don't know why I received this error on crashlytic. (ios platform)

React Native OneSignal SDK version

"react-native-onesignal": "^4.5.1".

Which platform(s) are affected?

  • [X] iOS
  • [ ] Android

Relevant log output

*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (OSIndirectNotification) for key (NS.objects) because no class named "OSIndirectNotification" was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target). If the class was renamed, use setClassName:forClass: to add a class translation mapping to NSKeyedUnarchiver

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

techday84 avatar Jun 26 '23 08:06 techday84

Hi @techday84,

Thank you for reporting this issue. Are you able to reproduce this yourself?

Also, did you update from a previous version of the react-native-onesignal SDK?

nan-li avatar Jun 26 '23 22:06 nan-li

@techday84 just checking to see whether you received our previous response? Any additional information would be appreciated!

jennantilla avatar Jul 18 '23 19:07 jennantilla

Closing due to no response.

jennantilla avatar Mar 19 '24 19:03 jennantilla