adjust / cordova_sdk

This is the Cordova SDK of
http://www.adjust.com
Other
37 stars 43 forks source link

Adjust.create() crashes the App with unrecognized selector sent to class #159

Closed sflepp closed 2 years ago

sflepp commented 2 years ago

Whenever a call to Adjust.create(...) is made, the App crashes with the following error message:

+[NSString adjJoin:]: unrecognized selector sent to class 0x2094b1248

The issue seems to be present in the example project example-ionic-capacitor as well: https://github.com/adjust/cordova_sdk/tree/master/example-ionic-capacitor

Tried different versions and combinations of the @ionic-native/adjust, @awesome-cordova-plugins/adjust and com.adjust.sdk but the problem persists.

uerceg commented 2 years ago

Hi @sflepp,

Did you check proposed solution in what might be the same issue you're experiencing (https://github.com/adjust/cordova_sdk/issues/151)?

sflepp commented 2 years ago

Hi @uerceg,

thanks, adding the cordovaLinkerFlags to the capacitor.config.json in the example project seems to have fixed the problem for me:

{
  "appId": "com.adjust.examples",
  "appName": "AdjustExample",
  "bundledWebRuntime": false,
  "npmClient": "npm",
  "webDir": "www",
  "plugins": {
    "SplashScreen": {
      "launchShowDuration": 0
    }
  },
  "cordova": {},
  "ios": {
    "cordovaLinkerFlags": ["-ObjC"]
  }
}

Would be nice if this were fixed in the example-project as well or some automated way while installing the SDK.

uerceg commented 2 years ago

Hey @sflepp,

Glad to hear that it worked for you. Makes sense, we'll add it. 👍

uerceg commented 2 years ago

Hey @sflepp,

We added some changes on this topic with v4.30.0 release. As of this release, native Adjust iOS framework is no longer being linked as a static framework dependency, but is being pulled from the Cocoapods instead. With this change, there should not be need for adding -ObjC flag to your app anymore.

Feel free to give it a shot and let us know if it worked for you without the flag.

I will close this issue now, but if needed, feel free to comment / reopen.

Cheers.