【问题标题】:error with nativescript-geolocation pluginnativescript-geolocation 插件出错
【发布时间】:2020-03-13 01:35:12
【问题描述】:

我在尝试启用位置时遇到了谷歌地图错误。

iv'e 安装了 google-maps-sdk 并在项目机器人中对其进行了配置,但出现了问题。

可能是什么问题?这是我第一次看到这个错误。

  • 这是错误
ERROR Error: JNI Exception occurred (SIGABRT).
JS: =======
JS: Check the 'adb logcat' for additional information about the error.
JS: =======
JS: ERROR Error: JNI Exception occurred (SIGABRT).
JS: =======
JS: Check the 'adb logcat' for additional information about the error.
JS: =======
JS: ERROR Error: Uncaught (in promise): Error: Cannot enable the location service. Error: JNI Exception occurred (SIGABRT).
JS: =======
JS: Check the 'adb logcat' for additional information about the error.
JS: =======
  • package.json
{
  "nativescript": {
    "id": "org.nativescript.DoHere",
    "tns-ios": {
      "version": "6.1.0"
    },
    "tns-android": {
      "version": "6.2.0"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "^8.2.14",
    "@angular/common": "^8.2.14",
    "@angular/compiler": "^8.2.14",
    "@angular/core": "^8.2.14",
    "@angular/forms": "^8.2.14",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "^8.2.14",
    "@angular/router": "^8.2.14",
    "nativescript-angular": "^8.2.2",
    "nativescript-geolocation": "^5.1.0",
    "nativescript-google-maps-sdk": "^2.8.1",
    "nativescript-theme-core": "~1.0.6",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.4.0",
    "tns-core-modules": "^6.2.1",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^8.2.14",
    "@ngtools/webpack": "~8.2.0",
    "nativescript-dev-webpack": "^1.3.0",
    "typescript": "~3.5.3"
  }
}

【问题讨论】:

  • 你的 gradle 版本是什么?
  • 在哪里可以查看 gradle 版本?在 gradle-wrapper.properties 文件中我只看到 {runtimeGradleVersion} 而在 build.gradle 文件中我看到 {runtimeAndroidPluginVersion} 那么我在哪里可以看到版本?
  • 你是如何安装 Gradle 的,如果你有 Android Studio 那么你可以在那里查看 Gradle 表单的版本。如果可以从 CLI 访问 gradle,则可以执行 gradle --version
  • 我在安装 android studio 时安装了 gradle。根据android studio中的项目结构,我的gradle版本是5.4.1。并且无法从我的 cli 访问 gradle

标签: android google-maps geolocation java-native-interface nativescript


【解决方案1】:

问题出在配置上。 我添加了一个文件 before-plugins.gradle

  • before-plugins.gradle
android {
  project.ext {
    googlePlayServicesVersion = "15.0.0"
  }
}

它现在正在工作。 谢谢@Manoj

【讨论】:

  • 你在哪里添加文件?
  • 好的!我没有注意到这里解释了所有内容 => github.com/NativeScript/…
  • 你在哪里找到了那个文件?在 nativescript 项目中我找不到这样的文件
  • 我在这个路径创建了文件:App_Resources/Android/before-plugins.gradle @Vytautas Pranskunas
猜你喜欢
  • 2021-12-13
  • 2021-11-27
  • 1970-01-01
  • 2020-02-07
  • 1970-01-01
  • 2018-11-17
  • 2020-05-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多