getsentry / sentry-cordova

The official Sentry SDK for Cordova
https://sentry.io/
MIT License
68 stars 55 forks source link

iOS release build error #308

Closed gsanseverino closed 1 year ago

gsanseverino commented 1 year ago

Hello,

running release build for ios I'm getting this error:

SentryCordova.m:105:13: error: use of undeclared identifier 'options'; did you mean 'optind'?
         if (options[@'store']) {
             ^~~~~~~
             optind

SentryCordova.m:105:19: error: subscript requires size of interface 'NSNumber', which is not constant for this architecture and platform
        if (options[@'store']) {
                   ^~~~~~~~~

it's not happening for debug builds.

I'm using cordova 11, sentry-cordova 1.1.4

gsanseverino commented 1 year ago

shouldn't the options variable be commandDictoinary instead?

marian-turchyn-oril commented 1 year ago

@gsanseverino You made my day. Thx. Changing variable is working.

awaken180-dev commented 1 year ago

How were you able to adjust this for the build?

gsanseverino commented 1 year ago

If you're using Ionic, the file is in the platforms/ios/<ProjectName>/Plugins/sentry-cordova folder

awaken180-dev commented 1 year ago

So you modify that file? Do you run into any issues when building in AppFlow? I was able to downgrade to 1.0.4 rather than 1.1.4 and my issue was resolved.

gsanseverino commented 1 year ago

If you change the file platforms/ios/<ProjectName>/Plugins/sentry-cordova/SentryCordova.m as explained in the first message, you can fix the issue.

But I'm not using AppFlow, so if platform files are generated in that pipeline, you have to find a different solution.