3
votes

I'm trying to build a Flutter app that also runs custom Java code, so that I can execute code in the background, set alarms etc. As such, I'd like to access Firebase from Java.

I've created a new Flutter project in Android Studio and added Firebase as documented here (manually).

It compiles and runs fine on the device, but it seems that the dependency .jars from Gradle are not picked up in Android Studio, and as a result my Java source files show a lot of errors - source being "cannot resolve symbol 'google'" in the import statements.

Is there anything special that I need to do in order to have Android Studio pick up external Java dependencies from Gradle in Flutter application projects? I'm running Android Studio 3.0 Beta 7.

1

1 Answers

0
votes

I have the same issue and would love to find the solution. I tried directly downloading the .aar file and using this guide but it did not work either.

https://github.com/yushulx/flutter-android-aar

Edit: I found an open issue on the topic which can be found here. Clearly you have found it, but in case anyone else is looking for more information about this.

Edit 2: Here is a workaround.