Flutter dependency in java plugin

Viewed 2809

I have opened android plugin of Firebase Auth but I cannot access flutter dependencies. What can I do to be able to use features like autocomplete?

When I run the code, everything works fine.

enter image description here

2 Answers

Alright, there is an easy solution for that!
Open Android studio and open the map viewer and make sure you are in the Project view. Picture showing project view

Now create a new directory and call it something like tmplibs. enter image description here

Alright, now navigate to your Flutter SDK directory. So where you cloned the Flutter repo. Then open the bin folder, after that the cache folder, followed by the artifacts folder, now open the engine folder and finally open the android-x64 folder.
So the path will look something like this:

...\flutter\bin\cache\artifacts\engine\android-x64  

In here, you'll find a file called flutter.jar. Copy that and paste it in your new tmplibs folder! enter image description here

Now right click on the flutter.jar file in project view in Android studio and click on Add As Library... enter image description here

Now open your module settings enter image description here

Finally click on Dependencies and changes the scope of tmplibs/flutter.jar to provided.
enter image description here

That's it!

Related