4

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

3 Answers 3

9

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!

Sign up to request clarification or add additional context in comments.

1 Comment

Why is this required? I've got coworkers on Macs that this isn't necessary for but for me on windows I had to add this reference
1

A better solution is to use the android project of the example app instead of the library. See this issue response on github: https://github.com/flutter/flutter/issues/11632

1 Comment

Could you please explain how? How would the change on example will be applied on the actual plugin ?
0

Bram Vanbilsen's solution resolves the problem. But comment the implementation line in build.gradle file after building the plugin.

dependencies {
  implementation files('tmplibs/flutter.jar')
}

If you run the example app without commenting the above line, it produces Duplicate dependencies error as the flutter source is included in the example app's build.gradle file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.