I have created an enum called CoreLengthUnits along with an extension named CoreLengthUnitsExtension for this enum. Neither of these components are related to firebase services. However, I'm getting an error as shown below. Due to this error, the test I want to run is unfortunately not working(Compilation failed for test). What could be the reason? any idea?
Furthermore, if I directly write the enum and its extension into the test file instead of importing them, and then remove the imports, I can run the test file without encountering any errors. However, even though the imported files don't contains any export lines, why might I still be receiving an unrelated error?
It seems that there might be an issue with package creation on Flutter 3 and above, or when testing older packages with the new Flutter version. While attempting to create a new package to isolate the issues I was facing in an existing package, I encountered an error related to Android embedding v2 during the creation of the new package.
Upon researching this, I came across an existing issue at this link: link. If you take a look at the link, you might get a better understanding of the problem.
In essence, there seems to be an issue related to the Flutter-pub side of things. Naturally, I followed the package creation process using the command
flutter create -t package test --no-pub
, and I transferred the package dependencies and contents to the new one I created using this command.
The result: I can now write and execute unit tests without any issue.
To summarize, if you created a package before version 3.0 and then try to use it on a system with Flutter 3.0 installed, you might encounter errors due to package dependencies. You can overcome this problem by creating a new package using the mentioned command and transferring the necessary files.
By the way, I found the command from this comment: link.