Getting error while using Huawei Crash service in cocos creator

I am newbie to Cocos creator and I am trying to implement Huawei crash service in a demo game.
While calling huawei.agc.crash.CrashService.enableCrashCollection(true), I am getting following error.
Apart from this I have already enabled crash from service panel. Please guide me where I am going wrong.

Simulator: E/jswrapper (274): ERROR: Uncaught ReferenceError: huawei is not defined, location: dst/assets/MainScript.js:0:0

STACK:

[0]onButtonClick@dst/assets/MainScript.js:38

[1]emit@src/cocos2d-jsb.js:28890

[2]emitEvents@src/cocos2d-jsb.js:28873

[3]_onTouchEnded@src/cocos2d-jsb.js:28466

[4]284.proto.emit@src/cocos2d-jsb.js:44772

[5]_doDispatchEvent@src/cocos2d-jsb.js:18271

[6]dispatchEvent@src/cocos2d-jsb.js:19164

[7]_touchEndHandler@src/cocos2d-jsb.js:18160

[8]_onTouchEventCallback@src/cocos2d-jsb.js:35636

[9]_dispatchEventToListeners@src/cocos2d-jsb.js:35722

[10]_dispatchTouchEvent@src/cocos2d-jsb.js:35671

[11]dispatchEvent@src/cocos2d-jsb.js:35923

[12]handleTouchesEnd@src/cocos2d-jsb.js:42767

[13]_mouseEventsOnElement@src/cocos2d-jsb.js:42914

[14]anonymous@src/cocos2d-jsb.js:42933

[15]dispatchEvent@jsb-adapter/jsb-builtin.js:3069

[16]anonymous@jsb-adapter/jsb-builtin.js:3141

E/jswrapper (574): [ERROR] (f:\jenkins\workspace\creator_2d\cocos2d-x-lite\windows\cocos2d-x-lite\cocos\scripting\js-bindings\jswrapper\v8\object.cpp, 574): Invoking function (1258D3F8) failed!

at HTMLElement.print-simulator-log (C:\CocosDashboard_1.0.9\resources.editors\Creator\2.4.2\resources\app.asar\editor\builtin\scene\panel\messages\scene.js:1:1606)

at Object.e._dispatch (C:\CocosDashboard_1.0.9\resources.editors\Creator\2.4.2\resources\app.asar\editor-framework\lib\renderer\panel.js:1:1876)

at EventEmitter. (C:\CocosDashboard_1.0.9\resources.editors\Creator\2.4.2\resources\app.asar\editor-framework\lib\renderer\ipc.js:1:2952)

at EventEmitter.emit (events.js:194:13)

at EventEmitter.emit (domain.js:469:20)

at EventEmitter.topLevelDomainCallback (domain.js:124:23)

We can ask @jare to take a look.

Sorry, HUAWEI AGC service or HMS service can only run on HUAWEI phone.

I was running it in simulator. Should I build the app for android and run it in Huawei phone?

Yes, HUAWEI AGC service or HMS service needs huawei phone and most of these framework only support android now.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.