我正在学习Nativescript,并试图在我的应用程序中使用谷歌地图。我使用一个名为nativescript-google-maps-sdk的Nativescript插件,当我使用地图去路线时,我的应用程序会出现错误。
下面是我的代码nativescript-google-maps-test。
Searching for devices...
Executing before-liveSync hook from
C:\Users\yo\proyectos\Aparcao\hooks\before-liveSync\nativescript-
angular-sync.js
Skipping prepare.
Installing...
Successfully installed on device with identifier 'emulator-5554'.
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.Aparcao on device emulator-5554.
Executing before-watch hook from C:\Users\yo\proyectos\Aparcao\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
ActivityManager: Start proc 12056:org.nativescript.Aparcao/u0a85 for activity org.nativescript.Aparcao/com.tns.NativeScr
iptActivity
18:33:26 - Compilation complete. Watching for file changes.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
System.err: java.lang.RuntimeException: Unable to resume activity {org.nativescript.Aparcao/com.tns.NativeScriptActivity
}: com.tns.NativeScriptException:
System.err: Calling js method onCreateView failed
System.err:
System.err: TypeError: Cannot read property 'CameraPosition' of undefined
System.err: File: "file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/nativescript-google-maps-sdk/map-vie
w.js, line: 217, column: 61
System.err:
System.err: StackTrace:
System.err: Frame: function:'MapView._createCameraPosition', file:'file:///data/data/org.nativescript.Aparcao/files/
app/tns_modules/nativescript-google-maps-sdk/map-view.js', line: 217, column: 62
System.err: Frame: function:'MapView.createNativeView', file:'file:///data/data/org.nativescript.Aparcao/files/app/t
ns_modules/nativescript-google-maps-sdk/map-view.js', line: 61, column: 35
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 412, column: 35
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/tns-core-modu
les/ui/core/view-base/view-base.js', line: 456, column: 19
System.err: Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files
/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_m
odules/tns-core-modules/ui/core/view/view-common.js', line: 699, column: 14
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 455, column: 14
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/tns-core-modu
les/ui/core/view-base/view-base.js', line: 456, column: 19
System.err: Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files
/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_m
odules/tns-core-modules/ui/core/view/view-common.js', line: 699, column: 14
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 455, column: 14
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/tns-core-modu
les/ui/core/view-base/view-base.js', line: 456, column: 19
System.err: Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files/app/
tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13
System.err: Frame: function:'PageBase.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns
_modules/tns-core-modules/ui/page/page-common.js', line: 206, column: 40
System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_m
odules/tns-core-modules/ui/core/view/view-common.js', line: 699, column: 14
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 455, column: 14
System.err: Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_
modules/tns-core-modules/ui/core/view-base/view-base.js', line: 357, column: 18
System.err: Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 346, column: 14
System.err: Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript
.Aparcao/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 504, column: 24
System.err: Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.Aparcao/files/app
/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38
System.err:
System.err: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3429)
System.err: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3469)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2732)
System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreateView failed
System.err:
System.err: TypeError: Cannot read property 'CameraPosition' of undefined
System.err: File: "file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/nativescript-google-maps-sdk/map-vie
w.js, line: 217, column: 61
System.err:
System.err: StackTrace:
System.err: Frame: function:'MapView._createCameraPosition', file:'file:///data/data/org.nativescript.Aparcao/files/
app/tns_modules/nativescript-google-maps-sdk/map-view.js', line: 217, column: 62
System.err: Frame: function:'MapView.createNativeView', file:'file:///data/data/org.nativescript.Aparcao/files/app/t
ns_modules/nativescript-google-maps-sdk/map-view.js', line: 61, column: 35
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 412, column: 35
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/tns-core-modu
les/ui/core/view-base/view-base.js', line: 456, column: 19
System.err: Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files
/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_m
odules/tns-core-modules/ui/core/view/view-common.js', line: 699, column: 14
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 455, column: 14
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/tns-core-modu
les/ui/core/view-base/view-base.js', line: 456, column: 19
System.err: Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files
/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_m
odules/tns-core-modules/ui/core/view/view-common.js', line: 699, column: 14
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 455, column: 14
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modules/tns-core-modu
les/ui/core/view-base/view-base.js', line: 456, column: 19
System.err: Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files/app/
tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13
System.err: Frame: function:'PageBase.eachChildView', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns
_modules/tns-core-modules/ui/page/page-common.js', line: 206, column: 40
System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_m
odules/tns-core-modules/ui/core/view/view-common.js', line: 699, column: 14
System.err: Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 455, column: 14
System.err: Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_
modules/tns-core-modules/ui/core/view-base/view-base.js', line: 357, column: 18
System.err: Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.Aparcao/files/app/tns_modu
les/tns-core-modules/ui/core/view-base/view-base.js', line: 346, column: 14
System.err: Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript
.Aparcao/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 504, column: 24
System.err: Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.Aparcao/files/app
/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: at com.tns.FragmentClass.onCreateView(FragmentClass.java:40)
System.err: at android.app.Fragment.performCreateView(Fragment.java:2353)
System.err: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
System.err: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
System.err: at android.app.BackStackRecord.run(BackStackRecord.java:816)
System.err: at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
System.err: at android.app.FragmentController.execPendingActions(FragmentController.java:371)
System.err: at android.app.Activity.performResume(Activity.java:6777)
System.err: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3406)
System.err: ... 10 more
ActivityManager: Process org.nativescript.Aparcao (pid 12056) has died
ActivityManager: cleanUpApplicationRecord -- 12056
提前谢了。
我在Windows10 Pro上得到了这个android错误:“TypeError:无法读取未定义的属性'Cameraposition'”。
对我有效的...
cd进入项目路径根目录,然后将nativescript升级到当前的最新版本:3.4.1
如果是,现在在模拟器或设备上运行(首先确保maps API密钥有效),然后运行:
tns运行android
问题内容: 我是Reactjs的新手。我正在尝试做一个非常简单的事情:当用户在文本区域内更改文本时,在render函数中更新div。有什么建议? 问题答案: 您应该绑定该函数。您收到此错误的原因是,在handleChange函数中,键盘操作未引用React类的上下文,因此您需要绑定该函数。 看到这个答案
我搜索了这个网站,发现了类似的问题,但没有解决我的问题。当我滚动到一个div时,我试图使它固定在屏幕顶部。但我一直在犯错误: "(index): 59未捕获类型错误:无法读取未定义的属性'top'at(index): 59" 我还在学习jQuery,不能解决这个问题。
问题内容: 我正在使用jQuery将表单字段发布到PHP文件,该文件仅根据是否工作而返回1/0。 代码摘录: 但是,每次成功(html == 1)时,控制台都会引发错误“未捕获的TypeError:无法读取未定义的属性’defaultView’”,并且警报永远不会发生…? Google似乎没有关于此错误和jQuery的大量信息,谁知道原因? 问题答案: 这是因为以前不是您要处理的内容,现在是jQu
我的代码: 错误: 未处理PromisejectionWarning:TypeError:无法读取未定义的未处理PromisejectionWarning:未处理的promise拒绝的属性“forEach”。此错误源于在没有catch块的情况下抛出异步函数的内部,或者拒绝使用未处理的promise。catch()。(拒绝id:1)(节点:7188)[DEP0018]弃用警告:未处理的promise
我正在尝试集成一个Datatable插件(https://www.npmjs.com/package/vuejs-datatable)在我的Vue应用程序中,我的控制台出现了一个错误。 我的dataTable.vue文件: 每当我尝试使用Vue时。使用(PluginName)'当集成插件时,我会遇到类似的错误。我是VueJS的新手。有什么我需要做的吗?
我基本上是React的初学者。我有一个仪表板页面,其中显示了一个React表。我有一个自定义按钮,它将打开一个弹出页面,这个弹出页面有一些复选框允许我显示/隐藏那些反应列。最初,此弹出页面中的所有复选框都设置为true。当我取消选中某列时,该列将被禁用。 这是我的父组件-父页面是带有ReactTable的页面,现在有10列,而不是像图中所示的8列。 这是我的子组件--在我的子页面(显示复选框的页面