"Device" plugin is not implemented on ios

I have a capacitor app that uses the @capacitor/device plugin, and I’m randomly getting errors saying "Device" plugin is not implemented on ios collected in Sentry. It works fine on my own device and in the simulator for various iOS devices. We’re using the latest version of Capacitor and all of its plugins. Our use of the plugin is very basic, we just use it to get the OS version like so:

      Device.getInfo().then(deviceInfo => {
        const majorVersion = parseInt(deviceInfo.osVersion.split('.')[0]);
        if ((isIosNativeApp() && majorVersion >= 13) || isWebApp()) {
          setButtonAllowed(true);
        }
      });

Here’s a screen capture from Sentry showing the stack trace and some other info. Any ideas on this one, thanks?

Anybody have any ideas on this? I removed the Device plugin, and now it’s giving me the same error about the RateApp plugin :sob:

have you checked iOS Troubleshooting Guide | Capacitor Documentation?

@julio-ionic Yep, I’ve done all of those things. Here’s my Podfile:

require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'

platform :ios, '13.0'
use_frameworks!

# workaround to avoid Xcode caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true

def capacitor_pods
  pod 'Capacitor', :path => '../../node_modules/.pnpm/@capacitor+ios@4.8.0_@capacitor+core@4.8.0/node_modules/@capacitor/ios'
  pod 'CapacitorCordova', :path => '../../node_modules/.pnpm/@capacitor+ios@4.8.0_@capacitor+core@4.8.0/node_modules/@capacitor/ios'
  pod 'AparajitaCapacitorBiometricAuth', :path => '../../node_modules/.pnpm/@aparajita+capacitor-biometric-auth@4.0.0/node_modules/@aparajita/capacitor-biometric-auth'
  pod 'AparajitaCapacitorSecureStorage', :path => '../../node_modules/.pnpm/@aparajita+capacitor-secure-storage@3.0.1/node_modules/@aparajita/capacitor-secure-storage'
  pod 'ByteowlsCapacitorOauth2', :path => '../../node_modules/.pnpm/@byteowls+capacitor-oauth2@4.0.2_@capacitor+core@4.8.0/node_modules/@byteowls/capacitor-oauth2'
  pod 'CapacitorCommunityFileOpener', :path => '../../node_modules/.pnpm/@capacitor-community+file-opener@1.0.4_@capacitor+core@4.8.0/node_modules/@capacitor-community/file-opener'
  pod 'CapacitorApp', :path => '../../node_modules/.pnpm/@capacitor+app@4.1.1_@capacitor+core@4.8.0/node_modules/@capacitor/app'
  pod 'CapacitorBrowser', :path => '../../node_modules/.pnpm/@capacitor+browser@4.1.1_@capacitor+core@4.8.0/node_modules/@capacitor/browser'
  pod 'CapacitorCamera', :path => '../../node_modules/.pnpm/@capacitor+camera@4.1.4_@capacitor+core@4.8.0/node_modules/@capacitor/camera'
  pod 'CapacitorClipboard', :path => '../../node_modules/.pnpm/@capacitor+clipboard@4.1.0_@capacitor+core@4.8.0/node_modules/@capacitor/clipboard'
  pod 'CapacitorFilesystem', :path => '../../node_modules/.pnpm/@capacitor+filesystem@4.1.5_@capacitor+core@4.8.0/node_modules/@capacitor/filesystem'
  pod 'CapacitorKeyboard', :path => '../../node_modules/.pnpm/@capacitor+keyboard@4.1.1_@capacitor+core@4.8.0/node_modules/@capacitor/keyboard'
  pod 'CapacitorPreferences', :path => '../../node_modules/.pnpm/@capacitor+preferences@4.0.2_@capacitor+core@4.8.0/node_modules/@capacitor/preferences'
  pod 'CapacitorSplashScreen', :path => '../../node_modules/.pnpm/@capacitor+splash-screen@4.2.0_@capacitor+core@4.8.0/node_modules/@capacitor/splash-screen'
  pod 'CapacitorRateApp', :path => '../../node_modules/.pnpm/capacitor-rate-app@3.1.0-beta.1_@capacitor+core@4.8.0/node_modules/capacitor-rate-app'
  pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
end

target 'App' do
  capacitor_pods
  # Add your Pods here
end

post_install do |installer|
  assertDeploymentTarget(installer)
end

One thing worth noting is that it almost always works. These errors are pretty infrequent and I can’t reproduce them, but I also don’t see a pattern in what causes them.

On iOS the only problem I’m aware of is having the WKAppBoundDomains key in the Info.plist.

Other than that, hard to help without a sample app.