execJSTypeError: xxx is not a function keeps reporting execJSTypeError: xxx is not a function

175 Views Asked by At

execJSTypeError: xxx is not a function keeps reporting execJSTypeError: xxx is not a function execJSTypeError: xxx is not a function keeps reporting execJSTypeError: xxx is not a function when the quick app accesses the advertising service

enter image description here

enter image description here

1

There are 1 best solutions below

0
Kanchan Thakur On

Basically the error message "execJSTYpeError: xxx.interstitialAd.load() is not a function" is displayed. This error indicates that the called function does not exist. The possible cause is that a vendor API that is not provided is called. It is found that the official website of Quick App Alliance provides the interstitialAd.load() API mentioned in the message, but Huawei does not provide it.

Solution:

During the development, call account.getProvider() to check whether some APIs are supported. If so, you may call them. For details, please refer to Account API.

if(account.getProvider()){

// some code

} Suggestion: When using a vendor service, use getProvider to check whether the service is supported and then call the specific API.

For details , please refer to , Cases: https://developer.huawei.com/consumer/en/doc/development/quickApp-Guides/quickapp-case-0000001082020374#section510218171618

For details about Interstitial Ads implementation, please refer to below official link:

Ads Kit:https://developer.huawei.com/consumer/en/doc/development/quickApp-References/quickapp-api-ad-0000001074754667 This document describes only the definition of APIs. For details about how and when to call these APIs, please refer to Integrating Ads Kit.

If still issue will persist, please feedback us with the following information to the developer support team: 1)Application Logs & SDK Logs

Please capture logs by Application Logs:

Connect the ADB tool to your device and run the following commands: adb shell setprop log.tag.hwads VERBOSE adb logcat -v threadtime 1> D:\hwadslogs.log Ads Kit logs:

Open the Files app, go to Categories > Internal storage > Android > data > com.huawei.hwid > files > Log > HiAdKitLog.log, and export the logs.

Method 2: Connect your phone to a computer and run the following ADB command to export logs from the phone. In the command, the dot (.) at the end indicates that the logs are stored in the current path.

adb pull /sdcard/Android/data/com.huawei.hwid/files/Log/HiAdKitLog.log ./

Note: If HiAdKitLog.log.bak exists, export it also.

If HiAdKitLog.log cannot be found, check whether the storage permission is enabled in HMS Core by going to Settings > Apps > Apps > HMS Core > Permissions, and making sure that Storage is enabled.

2)Screenshot of device details.

Settings > About Phone

3)HMs core version details.

Settings > Apps > HMS Core