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

Using recordError method iOS App Crashed - Plugin - 1.1.14-dev #148

Open
lav-sttl opened this issue Jan 2, 2019 · 6 comments
Open

Using recordError method iOS App Crashed - Plugin - 1.1.14-dev #148

lav-sttl opened this issue Jan 2, 2019 · 6 comments

Comments

@lav-sttl
Copy link

lav-sttl commented Jan 2, 2019

Ionic Info :
Ionic:

ionic (Ionic CLI) : 4.5.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.2

Cordova:

cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.1, ios 4.5.5
Cordova Plugins : no whitelisted plugins (14 plugins total)

System:

ios-deploy : 2.0.0
ios-sim : 7.0.0
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.4 Build version 9F1027a

Plugin Used
config.xml Files contains

screen shot 2019-01-02 at 3 37 13 pm

Tested Device
iPhone 6 Plus - OS - 12.1

Actual Behaviour :
App crashed and user can't do anything. User can't use after relaunch app again.

Expected Behaviour:
App should not be crashed and I just want to Add logs on Fabric Crashlytics.

Step to Produced:

  1. Called addLog Method :
    Add Logs
    2019-01-02 15:19:37.311726+0530 MyIonicApp[2760:412919] HomePage onLocationError - User denied location permission! --- TimeStamp: 1546422576932 --- DateTime: Wed Jan 02 2019 15:19:36 GMT+0530 (IST)

  2. Called this method after AddLogs method called.
    recordError('Error',-1);

Injectable service file

  • Called this methods on error block on individual component

screen shot 2019-01-02 at 3 51 07 pm

Debug Logs:

2019-01-02 15:19:37.311941+0530 WebClock[2760:412919] -[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000013
2019-01-02 15:19:37.316504+0530 WebClock[2760:412919] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000013'
*** First throw call stack:
(0x1f5d8fea0 0x1f4f61a40 0x1f5ca8d04 0x1f5d957b8 0x1f5d9745c 0x1f5dd5788 0x1f6722884 0x1012b2144 0x1012b2408 0x1013c3688 0x1013c2f7c 0x1013b91dc 0x1013c6040 0x1013b903c 0x1f684239c 0x1f5d201cc 0x1f5d2014c 0x1f5d1fa84 0x1f5d1a8fc 0x1f5d1a1cc 0x1f7f91584 0x222e15054 0x10129e004 0x1f57dabb4)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Is this expected behavior?

@lav-sttl lav-sttl changed the title iOS App Crashed - Plugin - 1.1.14-dev Using recordError method iOS App Crashed - Plugin - 1.1.14-dev Jan 2, 2019
@twltony
Copy link

twltony commented Jan 15, 2019

same issue, any update?

Ionic:

ionic (Ionic CLI) : 4.0.6 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8

Cordova:

cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.4, ios 4.5.5

System:

Android SDK Tools : 26.1.1
ios-deploy : 2.0.0
ios-sim : 6.0.0
NodeJS : v10.8.0 (/usr/local/bin/node)
npm : 6.2.0
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61

@allanpoppe
Copy link

Same issue here.

@marioperino
Copy link

Same issue here also

@maurotrigo
Copy link

+1

1 similar comment
@taras101
Copy link

+1

@amymarsh4work
Copy link

amymarsh4work commented Jul 18, 2019

I had this problem too. Now I have it working. I believe what I was doing wrong was that I was passing an instance of Error into the reportError method as the first parameter. It needs to be a string.

It helped me to look at: ./plugins/cordova-fabric-plugin/typings/cordova-fabric-plugin.d.ts:
// Used to record a non-fatal error message (iOS only).
recordError(message: string, code: number): void;

Solution (simplified):
handleError(error: any) {
const errMsg = this.extractMessage(error);
this.sendErrorReport(errMsg);
}

private extractMessage(error: any): string {
return (error.message) ? error.message :
(error.statusText) ? error.statusText : error.toString();
}

private sendErrorReport(message): void {
if (this.iOS) {
const code = 0;
this.crashlytics.recordError(message, code);
} else {
this.crashlytics.sendNonFatalCrash(message);
}
}

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

7 participants