plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]:

Open SaritaAgravat opened this issue 2 months ago • 2 comments

Platform

Android 15 and android 16

Plugin

device_info_plus

Version

12.2.0

Flutter SDK

3.27.0

Steps to reproduce

MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info) all are setup but device info still not working. current version is device_info_plus: ^12.2.0 minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' all are added. tyr to adding rules also. But still not working.

Code Sample


Logs

MissingPluginException(No implementation found for method getDeviceInfo on channel dev.fluttercommunity.plus/device_info)

Flutter Doctor

Yes adding

Checklist before submitting a bug

  • [x] I searched issues in this repository and couldn't find such bug/problem
  • [x] I Google'd a solution and I couldn't find it
  • [x] I searched on StackOverflow for a solution and I couldn't find it
  • [x] I read the README.md file of the plugin
  • [x] I'm using the latest version of the plugin
  • [x] All dependencies are up to date with flutter pub upgrade
  • [x] I did a flutter clean
  • [x] I tried running the example project

SaritaAgravat avatar Oct 28 '25 06:10 SaritaAgravat

@SaritaAgravat Please check are you re initializing the DeviceInfoPlugin object in your code. DeviceInfoPlugin mean to used as a singleton -> avoid reinitialising it In debug mode -> It doesn't throw any errors but in release mode -> It got exception of MissingPlugin

In your helper (like DeviceUtil -> keep the object of DeviceInfoPlugin static -> This will solve the issue of getting reinitialised ) static final DeviceInfoPlugin _deviceInfoPlugin = DeviceInfoPlugin()

Additional make sure you added following rules in proguard file : #Prevent device_info_plus plugin classes from being stripped -keep class io.flutter.plugins.deviceinfo.** { ; } -keep class com.example.device_info_plus.* { *; }

#Keep the Build class and version info -keep class android.os.Build { *; } -keep class android.os.Build$VERSION { *; } -keepclassmembers class android.os.Build$VERSION { *; }

#Keep reflective access to fields used internally -keepattributes Annotation,InnerClasses

Hope this helps

mr-vishwet avatar Nov 03 '25 12:11 mr-vishwet

Without code sample it is hard to help.

vbuberen avatar Dec 07 '25 15:12 vbuberen