flutter-unity-view-widget
flutter-unity-view-widget copied to clipboard
Project with path 'FirebaseApp.androidlib' could not be found in project ':unityLibrary'.
I really love the flutter-unity-plugin and would be happy if someone could give me a hint on how to solve this issue:
Since I added the FirebaseApp package to Unity, Flutter won't build anymore after exporting from Unity. Instead, I get the following error:
* Where:
Build file 'C:\Users\xyz\AndroidStudioProjects\flun\android\unityLibrary\build.gradle' line: 59
* What went wrong:
A problem occurred evaluating project ':unityLibrary'.
> Project with path 'FirebaseApp.androidlib' could not be found in project ':unityLibrary'.
This specific line 59 is this: implementation project('FirebaseApp.androidlib')
Now, I do have a folder "FirebaseApp.androidlib" right in the "unityLibrary" folder that gets recreated every time I export from Unity. So, the files should be there and I am afraid it has something to to with 'importing' it the right way. Hopefully it is just a simple line somewhere in build.gradle or settings.gradle
Any help would be appreciated :)
Unity 2020.1.17 Flutter 1.22 flutter_unity_widget: ^4.0.1+1 Windows 10
I had a similar issue with integrating Unity and Firebase with this plugin. While I wasn't able to actually solve it, I did find a way to get past it.
Since you can send and receive virtually any kind of data (ideally, encoded JSON data) from Unity to Flutter with the API provided by the plugin, you can simply use that to manage whatever data you wanna send/receive and let Flutter handle the Firebase implementation instead.
That worked well for me and it's something you'll most likely have to do anyway if you're planning on using Firebase with Flutter too, as using Firebase with both Flutter and Unity is treated as duplicated implementations, which isn't allowed by the native environments.
Thank you, @thassio-vinicius for your helpful response. Using Flutter for all Firebase-related stuff is indeed an option, I'm just afraid the underlying problem might occur with other plugins as well, not just with Firebase. And in case it really is just a simple line in build.gradle or settings.gradle file (I am a total noob here), it might not only solve this issue here, but also the same problem for other Unity plugins. Dont know if that makes sense though :)
Did anyone make any progress on this topic? Running into the same issue with: Unity 2020.3.20f1 Flutter 2.5.3 flutter_unity_widget: ^4.2.3 Windows 10
Cheers
I had a similar issue with integrating Unity and Firebase with this plugin. While I wasn't able to actually solve it, I did find a way to get past it.
Since you can send and receive virtually any kind of data (ideally, encoded JSON data) from Unity to Flutter with the API provided by the plugin, you can simply use that to manage whatever data you wanna send/receive and let Flutter handle the Firebase implementation instead.
That worked well for me and it's something you'll most likely have to do anyway if you're planning on using Firebase with Flutter too, as using Firebase with both Flutter and Unity is treated as duplicated implementations, which isn't allowed by the native environments.
You're right...I'm using firebase in both flutter and unity. When I tried to run in debug mode, there were many duplicated classes error occurred in debug console
By the way, to solve this issue, simply add these lines in settings.gradle
include ":unityLibrary:FirebaseApp.androidlib"
project(":unityLibrary:FirebaseApp.androidlib").projectDir = file("./unityLibrary/FirebaseApp.androidlib")