Geofence:未捕获(已承诺):找不到类

问题描述 投票:1回答:1

初始化Geofence引发未捕获的错误“未找到类”

已经尝试:

  1. 删除/添加Android平台
  2. 平台准备就绪后使用]
  3. 在设备和模拟器上安装了Google Play服务
  4. Liveload工作指定错误,但在安装cordova-plugin-geofence后构建android无法工作
  5. 我在安装时收到此消息

PS C:\Users\one solution\mrca> ionic cordova plugin add cordova-plugin-geofence
    > cordova.cmd plugin add cordova-plugin-geofence
    Installing "cordova-plugin-geofence" for android
    Installing "cordova-plugin-add-swift-support" for android
    Android Studio project detected
    **Installing "cordova-plugin-compat" for android
    Plugin doesn't support this project's cordova-android version. cordova-android: 7.1.4, failed version requirement:
          <6.3.0
    Skipping 'cordova-plugin-compat' for android**
    Installing "es6-promise-plugin" for android
    Subproject Path: CordovaLib
    Subproject Path: app
    Adding cordova-plugin-geofence to package.json

Ionic:

   Ionic CLI                     : 5.2.5 (C:\Users\onesolution\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.6.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 7.1.4
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 17 other plugins)

Utility:

   cordova-res : 0.6.0 (update available: 0.8.0)
   native-run  : 0.2.8

System:

   NodeJS : v10.16.1 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 10

home.page.ts

 constructor(private geofence: Geofence) {
         geofence.initialize().then(
           // resolved promise does not return a value
           () => console.log('Geofence Plugin Ready'), //<-- Expected
           (err) => console.log(err)  //<- Class not found
         ) }

发生错误

core.js:15724 ERROR Error: Uncaught (in promise): Class not found
        at resolvePromise (zone.js:831)
        at zone.js:741
        at geofence.js:143
        at Object.callbackFromNative (cordova.js:293)
        at processMessage (cordova.js:1115)
        at processMessages (cordova.js:1138)
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
        at Object.onInvoke (core.js:17299)
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
        at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)

回购bitbucketgit clone https://[email protected]/umesh0510/geofence-test.git

预期:地理围栏插件就绪

初始化Geofence引发未捕获的错误“未找到类”已经尝试:在平台准备就绪后使用设备删除/添加Android平台在设备和仿真器上安装Google Play服务...

android cordova cordova-plugins ionic4 ionic-native
1个回答
0
投票

在使用应用程序版本插件的情况下,我的应用程序Ionic4中遇到Class Not Found错误,因为我正在使用livereload功能测试我的应用程序。我们应该只要在应用程序中安装了新插件,就应该再次构建应用程序,特别是在进行livereload时

© www.soinside.com 2019 - 2024. All rights reserved.