ABausG / home_widget

Flutter Package for Easier Creation of Home Screen Widgets
786 stars 218 forks source link

Unresolved reference: HomeWidgetProvider #294

Open Tgarfr opened 2 months ago

Tgarfr commented 2 months ago

Problem to solve

HomeWidgetProvider is not recognized by AndroidStudio, how does it find this class?

Proposal

How to transfer the Flutter plugin to Android?

More information

No response

Which Platform would be improved?

Android

Other

eeoom commented 1 month ago

Same here, any suggestions?

Meriemi-git commented 4 weeks ago

I had the same problem after adding home_widget to flutter pubspec.yml HomeWidgetProvider wasn't resolved as any of the es.antonborri.home_widget kotlin classes.

To permit Android Studio to resolve dependencies i removed home_widget dependency, re-sync gradle, re-add dependency and sync gradle again, and it works, all es.antonborri.home_widget kotlin classes are were resolved.

NB: I have two Android studio launched, the first for flutter coding, flutter pub add/remove, with project dir opened and the second opened on android folder for kotlin coding and gradle sync

ABausG commented 4 weeks ago

Thank you @Meriemi-git I think one thing is very important:

the second opened on android folder for kotlin coding and gradle sync

when manipulating the native android files you should open android studio at the android folder of your app because Android Studio when configured as a "Flutter Dev" environment doesn't properly use all the android tools