You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/12 20:13:28 UTC

[GitHub] [cordova-plugin-device-orientation] pdrhlik opened a new issue #63: CompassError code 3 on Android 10

pdrhlik opened a new issue #63:
URL: https://github.com/apache/cordova-plugin-device-orientation/issues/63


   # Bug Report
   
   ## Problem
   When subscribing to a `watchHeading` function, I get a `CompassError {code: 3}` response. It works on older Android phones. I haven't tested iOS. If I browsed the code correctly. The error code is neither one of `CompassError.COMPASS_INTERNAL_ERR CompassError.COMPASS_NOT_SUPPORTED`.
   
   ### What is expected to happen?
   It should work.
   
   
   ### What does actually happen?
   I get an undocumented `CompassError`.
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   It doesn't work on Android 10.
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   ```
   import { DeviceOrientation } from '@ionic-native/device-orientation/ngx';
   
   constructor(
       private deviceOrientation: DeviceOrientation
     ) { }
   
   this.compass = this.deviceOrientation.watchHeading({frequency: 500}).subscribe(data => {
          // logic
   });
   ```
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
    I used Angular 11, Ionic framework 5 and Capacitor.
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   `ionic info` output:
   
   ```
   Ionic:
   
      Ionic CLI                     : 6.13.1 (/usr/local/lib/node_modules/@ionic/cli)
      Ionic Framework               : @ionic/angular 5.6.4
      @angular-devkit/build-angular : 0.1102.8
      @angular-devkit/schematics    : 9.1.0
      @angular/cli                  : 11.2.8
      @ionic/angular-toolkit        : 2.3.3
   
   Capacitor:
   
      Capacitor CLI   : 2.4.7
      @capacitor/core : 2.4.7
   
   Cordova:
   
      Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms : not available
      Cordova Plugins   : not available
   
   Utility:
   
      cordova-res (update available: 0.15.3) : 0.15.2
      native-run (update available: 1.3.0)   : 1.2.2
   
   System:
   
      Android SDK Tools : 26.1.1 (/Users/datigo/Library/Android/sdk)
      ios-deploy        : 1.10.0
      ios-sim           : ios-sim/9.0.0 darwin-x64 node-v12.18.3
      NodeJS            : v12.18.3 (/usr/local/Cellar/node@12/12.18.3/bin/node)
      npm               : 6.14.6
      OS                : macOS Catalina
      Xcode             : Xcode 12.4 Build version 12D4e
   ```
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device-orientation] pdrhlik closed issue #63: CompassError code 3 on Android 10

Posted by GitBox <gi...@apache.org>.
pdrhlik closed issue #63:
URL: https://github.com/apache/cordova-plugin-device-orientation/issues/63


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device-orientation] breautek commented on issue #63: CompassError code 3 on Android 10

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #63:
URL: https://github.com/apache/cordova-plugin-device-orientation/issues/63#issuecomment-818697245


   We can leave this ticket as a reminder to improve documentation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device-orientation] breautek commented on issue #63: CompassError code 3 on Android 10

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #63:
URL: https://github.com/apache/cordova-plugin-device-orientation/issues/63#issuecomment-818232652


   Error code 3 means the android device doesn't have a sensor available to use:
   
   https://github.com/apache/cordova-plugin-device-orientation/blob/ee05df544d7a0c7514a3303193bf9413d41cfcbe/src/android/CompassListener.java#L180
   
   Despite of the suppress deprecation, the method doesn't appear to be deprecated: https://developer.android.com/reference/android/hardware/SensorManager#getSensorList(int)
   
   So this suggest that your device doesn't have an Orientation sensor. The constant is [deprecated](https://developer.android.com/reference/android/hardware/Sensor#TYPE_ORIENTATION) however, so perhaps you can try replacing it with `SensorManager.getOrientation()` instead?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device-orientation] pdrhlik commented on issue #63: CompassError code 3 on Android 10

Posted by GitBox <gi...@apache.org>.
pdrhlik commented on issue #63:
URL: https://github.com/apache/cordova-plugin-device-orientation/issues/63#issuecomment-818476496


   Thanks a lot for the clarification @breautek. I didn't realise my phone doesn't have the sensor, which really is the case. So everything's ok then.
   
   I would only suggest documenting `ERROR_FAILED_TO_START` on the main page so it's a bit more obvious for other people. Thanks again!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org