Share via

Accelerometer Error

Grime 796 Reputation points
2021-01-06T11:11:23.687+00:00

I created an Android/iOS app on my laptop running VS 2019. The Android version works well and is now published on the Google Play Store (look for Fartz by Grime). During development, apart from various simulators/emulators, my physical testing platforms were an oldish Nexus 6 (for Android testing) and my newish iPhone 11. The app works fine on both of them, but I was unable to create a Launch Screen on iOS on my laptop because of the storyboard non-compliance issue, so it was recommended that I on-develop the iOS version on the Mac.
Via GitHub, I have transferred the code to the Mac (also running VS 2019) and on running, am getting an issue with the Xamarin.Essentials accelerometer usage. I'll put the error here, but I've got to say, it worked when deployed via my PC laptop.
Any help would be greatly appreciated.
Error:
Xamarin.Essentials.FeatureNotSupportedException: Specified method is not supported.
at Xamarin.Essentials.Accelerometer.Start (Xamarin.Essentials.SensorSpeed sensorSpeed) [0x00007] in D:\a\1\s\Xamarin.Essentials\Accelerometer\Accelerometer.shared.cs:25
at Fartz.MainPage.OnAppearing () [0x00026] in /Users/graeme/Projects/FartzV2/Fartz/Fartz/View/MainPage.xaml.cs:35
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/Foundation/NSAction.cs:178
at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at Fartz.iOS.Application.Main (System.String[] args) [0x00001] in /Users/graeme/Projects/FartzV2/Fartz/Fartz.iOS/Main.cs:17

Developer technologies | .NET | Xamarin
0 comments No comments

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,971 Reputation points
    2021-01-06T12:53:40.03+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    but I was unable to create a Launch Screen on iOS on my laptop because of the storyboard non-compliance issue

    It supports to deploy the Xamarin.iOS project in windows. Try to pair to the Mac for Xamarin.iOS development and check the Remote Simulator to Windows option.

    Check the docs:
    https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/connecting-to-mac/
    https://learn.microsoft.com/en-us/xamarin/tools/ios-simulator/

    Error: Xamarin.Essentials.FeatureNotSupportedException: Specified method is not supported.

    This is because the simulator doesn't support the Accelerometer function, please test the function on a physical device instead.

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.