I have a strange error where one of the plugins I used for a long time suddenly started to give Unresolved reference errors (either if called directly, or not found at all when the toolchain tries to instantiate it from GeneratedPluginRegistrant.java
). Import statements are present and correct. The really challenging part is that the same app compiles all right if initiated from the command line (flutter.bat build appbundle ...
) and only shows the error when built from the IDE, which is Android Studio.
I get the usual error:
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
But how can I get the log? I’m well aware of earlier similar questions but they don’t work any more. Adding any of the options above to Settings > Build > Gradle-Android compiler > Command-line options has no influence. I do add -v
to flutter run
and the resulting output will be rather verbose, yes, but it shows everything before the error above in a verbose manner while it doesn’t add any useful information to the actual error (apart from a stacktrace inside the compiler that is completely uninteresting here).
Using gradlew.bat --verbose
, while working, doesn’t interest me because, as I mentioned above, the error only appears when run from under the IDE, so a command line run will not help me.
I also tried GRADLE_OPTS
or adding --debug
directly into gradlew.bat
in the line where it assembles the command but it doesn’t change a thing in the output, or at least not anywhere that I can see it.
Versions for reference:
- Flutter 3.24.0
- Dart 3.5.0
- Gradle 7.6
- Android Studio 2024.1
Caches were cleared many times, including File > Invalidate Caches in AS and also manually during testing. The problem can be reproduced with the relevant plugin stored both in the usual Pub package cache and as a local copy.