leandrorlls / nativescript-microsoft-appcenter

Microsoft App Center plugin for NativeScript
Apache License 2.0
13 stars 9 forks source link

ERROR ReferenceError: MSAppCenter is not defined #15

Open hendrikschneider opened 3 years ago

hendrikschneider commented 3 years ago

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I setup the plugin with nativescript 7.2.0 and when starting I get this error:

CONSOLE ERROR: ERROR ReferenceError: MSAppCenter is not defined

When configuring the plugin in main.tns.ts this error appears:

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught ReferenceError: MSCrashes is not defined
at
push.../node_modules/nativescript-microsoft-appcenter/microsoft-appcenter.js.AppCenterDelegate.applicationDidFinishLaunchingWithOptions(file: node_modules/nativescript-microsoft-appcenter/microsoft-appcenter.ios.js:113:0)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught ReferenceError: MSCrashes is not defined
at
push.../node_modules/nativescript-microsoft-appcenter/microsoft-appcenter.js.AppCenterDelegate.applicationDidFinishLaunchingWithOptions(file: node_modules/nativescript-microsoft-appcenter/microsoft-appcenter.ios.js:113:0)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
2   NativeScript                        0x0000000105bcc914 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v85LocalINS1_7MessageEEENS2_INS1_5ValueEEE + 914
3   NativeScript                        0x000000010602cf65 _ZN2v88internal14MessageHandler25ReportMessageNoExceptionsEPNS0_7IsolateEPKNS0_15MessageLocationENS0_6HandleINS0_6ObjectEEENS_5LocalINS_5ValueEEE + 341
4   NativeScript                        0x000000010602cdd4 _ZN2v88internal14MessageHandler13ReportMessageEP<…>
igorkra commented 3 years ago

same issue for me

Archez commented 3 years ago

This plugin does not specify an exact version for the required pod AppCenter, and unfortunately the Pod as of version 4.0.0+ has renamed the prefix for variables from MS to MSAC in the Obj-C code (breaking change). This means when building a project using this plugin today, the latest version of the Pod is used and will cause the issues above.

AppCenter 3.3.4 is the latest version that still uses the old variable names, so this plugin will need to have the pod file updated to target that version. pod 'AppCenter' ~> '3.3.4' Or target the new Pod version and update the plugin code to reference the correct variable names (and other core changes); however, this plugin hasn't been updated in a while unfortunately.