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]: NSInvalidUnarchiveOperationException. #1531

Closed
2 of 3 tasks
techday84 opened this issue Jun 26, 2023 · 3 comments
Closed
2 of 3 tasks

[Bug]: NSInvalidUnarchiveOperationException. #1531

techday84 opened this issue Jun 26, 2023 · 3 comments

Comments

@techday84
Copy link

techday84 commented Jun 26, 2023

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?

  • 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

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

nan-li commented Jun 26, 2023

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?

@jennantilla
Copy link
Contributor

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

@jennantilla
Copy link
Contributor

Closing due to no response.

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