当前位置:网站首页>How to solve the problems when using TV focusable to package APK in uni app

How to solve the problems when using TV focusable to package APK in uni app

2022-06-13 01:23:00 Durian is not delicious

Many little cute reactions use uni-app Framework for the integration tv-focusable Development , Pack it up apk The following error will occur in the case of ,

 reportJSException >>>> exception function:createInstanceContext, exception:white screen 
 cause create instanceContext failed,check js stack ->Uncaught TypeError: 
 Cannot read property 'CustomEvent' of undefined

This is the question today , Talk about the causes , And Solutions :

Take a look first uni-app Description of official release documents , Pay attention to the red line .
 Insert picture description here
in other words uni-app In Africa h5 End development , Will remove some of the browser's own objects , Among them is CustomEvent Custom events , But this is required for any library that involves custom events api, unfortunately tv-focusable Also used. , therefore uni-app In the process of packaging apk The compilation fails when , So as to report this error .

Having finished the reason for the error report , Next, let's talk about the solution , It's very simple :
1. First , Modify the basic path : manifest.json modify “base”:"./" And then it's packaged into h5, Then make sure you can run the test in the browser , If everything goes well , We can go on to the next step ;

2. Will just generate the h5 The project with hbuilder Again into APP.( If you don't know how to turn , See the link below )
How to integrate h5 Pack it up apk, Please poke here

原网站

版权声明
本文为[Durian is not delicious]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280552464193.html