{N} Nativescript 6-TypeError:无法读取未定义的属性"ViewCompat" [英] {N} Nativescript 6 - TypeError: Cannot read property 'ViewCompat' of undefined
问题描述
从NS 5更新到NS 6后,尝试在Android上运行我的应用程序时出现以下错误:
After updating from NS 5 to NS 6, I got the following error when trying to run my application on Android:
[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'ViewCompat' of undefined"
推荐答案
事实证明这是我使用的插件中的一个问题,需要对其进行更新才能使用AndroidX支持库.我通过在插件中搜索字符串"ViewCompat"找到了它-您应该看到对AndroidX的引用,而不是android.support.具体来说,我通过将旧版本的nativescript-loading-indicator更新为@ nstudio/nativescript-loading-indicator解决了我的问题.
This turned out to be a problem in a plugin I was using that needed to be updated to use the AndroidX support library. I found it by searching my plugins for the string 'ViewCompat' - you should see a reference to AndroidX rather than android.support. Specifically, I resolved my issue by updating from an older version of nativescript-loading-indicator to @nstudio/nativescript-loading-indicator.
这篇关于{N} Nativescript 6-TypeError:无法读取未定义的属性"ViewCompat"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!