NativeScript nativescript-google-maps-sdk无法正常运行

德吉什饶

我是纯Javascript开发人员(angularjs和nodejs),对android或ios应用也不了解。我遵循了nativescipt的教程,并在以下链接的帮助下在nativescipt(angular)中创建了一个应用程序:使用Angular 2连线Google Maps Nativescript插件,
但在运行之后:tns插件添加nativescript-google-maps-sdk并在tns run android此处运行命令是一个例外

    D:\ts\app\sample-Groceries>tns run android
    Executing before-prepare hook from D:\ts\app\sample-Groceries\hooks\before-prepare\nativescript-dev-typescript.js
    Found peer TypeScript 1.8.10
    Project successfully prepared
    WARNING: The file: D:\ts\app\sample-Groceries\node_modules\nativescript-google-maps-sdk\platforms\android\AndroidManifest.xml is depricated, you can read more about what will be the expected plugin structure here: https://www.nativescript.org/blog/migrating-n-android-plugins-from-version-1.7-to-2.0
    WARNING: The file: D:\ts\app\sample-Groceries\node_modules\nativescript-google-maps-sdk\platforms\android\res\values\nativescript_google_maps_api.xml is depricated, you can read more about what will be the expected plugin structure here: https://www.nativescript.org/blog/migrating-n-android-plugins-from-version-1.7-to-2.0

    :config phase:  createDefaultIncludeFiles
            +found plugins: nativescript-google-maps-sdk
     {
                  "F0" {
                    dimension "nativescriptgooglemapssdk"
                  }
                }
    }Renaming plugin directory to flavor name: D:\ts\app\sample-Groceries\platforms\android\src\nativescript-google-maps-sdk
-> D:\ts\app\sample-Groceries\platforms\android\src\F0
            +found plugins: tns-core-modules-widgets
     {
                  "F1" {
                    dimension "tnscoremoduleswidgets"
                  }
                } }Renaming plugin directory to flavor name: D:\ts\app\sample-Groceries\platforms\android\src\tns-core-modules-widgets
 D:\ts\app\sample-Groceries\platforms\android\src\F1

    :config phase:  createPluginsConfigFile
             Creating product flavors include.gradle file in D:\ts\app\sample-Groceries\platforms\android/configurations folder...

    :config phase:  pluginExtend
            +applying configuration from: D:\ts\app\sample-Groceries\platforms\android\configurations\include.gradle
            +applying configuration from: D:\ts\app\sample-Groceries\platforms\android\configurations\nativescript-google-maps-sdk\include.gradle
            +applying configuration from: D:\ts\app\sample-Groceries\platforms\android\configurations\tns-core-modules-widgets\include.gradle

    :config phase:  copyAarDependencies

    :config phase:  addAarDependencies
            +adding dependency: D:\ts\app\sample-Groceries\platforms\android\libs\aar\widgets-release.aar

    FAILURE: Build failed with an exception.

我已经访问了页面https://www.nativescript.org/blog/migrating-n-android-plugins-from-version-1.7-to-2.0,但没有获得解决此异常的任何信息。

尼古拉·特索尼夫

可能的解决方案是尝试使用删除android平台,tns platform remove android然后使用再次添加tns platform add android

关于nativescript-google-maps-sdk插件。我已经使用此插件从头开始创建了示例项目。您可以在此处查看它:NativeScript-Angular-GoogleMaps最重要的部分是添加

NativeScript-Angular-GoogleMaps/app/App_Resources/Android/values/nativescript_google_maps_api.xml 此代码段

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="nativescript_google_maps_api_key">API_KEY</string>
</resources>

并在文件末尾添加 node_modules/nativescript-angular/element-registry.js

这条线

registerElement("mapView", function () { return require("nativescript-google-maps-sdk").MapView; });

此行将帮助NativeScript找到MapView元素。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

NativeScript nativescript-google-maps-sdk无法正常运行

来自分类Dev

使用Angular 2连接Google Maps Nativescript插件

来自分类Dev

Nativescript 命令运行

来自分类Dev

tns运行android --emulator无法正常工作-NativeScript

来自分类Dev

NativeScript在android 4.4以下无法正常工作

来自分类Dev

NativeScript 中的 httpinterceptor 无法正常工作

来自分类Dev

Nativescript 接受 Android SDK 许可

来自分类Dev

Nativescript vue devtools无法连接

来自分类Dev

NativeScript Google-Places API --> 如何使用?

来自分类Dev

Google Maps for Angular指令无法正常运行

来自分类Dev

Nativescript openUrl

来自分类Dev

NativeScript打字

来自分类Dev

没有--bundle选项,Nativescript-vue无法正常工作

来自分类Dev

在NativeScript中在后台运行任务

来自分类Dev

NativeScript-TNS上的错误运行android

来自分类Dev

Nativescript iOS应用未在设备上运行

来自分类Dev

如何为 Nativescript 捆绑运行 android

来自分类Dev

Nativescript无法获得幻灯片事件

来自分类Dev

无法在NativeScript和android中调试

来自分类Dev

Nativescript 无法构建 - v3

来自分类Dev

NativeScript应用程序无法在IOS上运行

来自分类Dev

无法在 IOS 设备版本 12.0.1 上运行 Nativescript

来自分类Dev

在设备IOS上运行的Nativescript-dyld库未加载@ rpath / Nativescript.framework

来自分类Dev

NativeScript Vue nativescript-sqlite 无法分配给“#<Object>”的只读属性“exports”对象

来自分类Dev

Google Maps API 3-地理编码无法正常运行

来自分类Dev

Nativescript:是否可以通过Typescript访问android sdk函数/类?

来自分类Dev

Nativescript 2.2异常

来自分类Dev

NativeScript滑块步骤

来自分类Dev

Nativescript无限翻译动画

Related 相关文章

热门标签

归档