-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Failed to find plugin com.android.tools.build:gradle" within a Flutter Android project #1289
Comments
Please create a minimal example project which demonstrates this issue, upload it to GitHub, and post the link here. |
@mhsmith , thank you for the quick reply and for looking into this. The GitHub repo is: https://github.com/gyuri-fluttech/chaquopy_gradle_sync_issue.git |
@mhsmith did you have any luck? We are currently running into this issue, it's quite a blocker, and I can also not find any solution so far. |
Sorry for the slow reply. It looks like this is caused by the way the Gradle plugins are applied. The Android Studio new project wizard creates projects which declare their plugins in the top-level build.gradle file. But based on this page, Flutter evidently prefers them to be declared in the settings.gradle file instead. It looks like the Chaquopy plugin is unable to detect the Android plugin in this case. We'll fix this in the next version of Chaquopy. Meanwhile, you can work around it like this:
In your minimal project this will first give an error "Chaquopy requires ndk.abiFilters". Add the Then it fails with this error:
But that happens even if the Chaquopy plugin is commented out, so it must be unrelated. |
@mhsmith Thank you so much, I'll test this workaround. |
@mhsmith , I appreciate looking into this, Malcolm. I tried applying your workaround on my example project but a different error appears. Could you check my PR if I did what you suggested or if I missed something ? The error is exactly the same as @ngreedy mentioned but for some reason he removed his comment. |
Like I said, you should leave the Flutter plugin in the settings.gradle file. Only move the Android, Chaquopy and Kotlin plugins. |
Ah, damn, I thought you were referring only to the
|
The workaround seams successful for me too. I'm currently dealing with what seam like follow-up issues due to the new Gradle Version. I'll keep you posted. |
I have some very strange behaviour settings.gradle
build.gradle
module build.gradle
and I get the following error log:
It might be worth noting, that the same config with 3.10 and so on worked flawlessly before updating the Flutter version as well as the gradle version. |
@mhsmith My apologies for the confusion! I realized I was using the wrong build pipeline, and Python 3.10 wasn’t installed correctly on the build machine for that workflow. Everything is now working perfectly. Thank you for your patience! As a suggestion, perhaps there could be a clearer error message if Python is not installed in the correct version on the build machine. It might help others troubleshoot similar issues more quickly. |
Good idea: I've recorded it in #1295. |
Maybe my case is the same but the log is a bit different, when I comment
|
I haven't seen this error before, and I'm not sure whether it's related. Please post the full stack trace. To display it you may need to click the “Build: failed” caption to the left of the error. |
@mhsmith thanks for your response! I have tested again (comment out chaquopy plugin) with your suggested configuration and still failed so it means com.chaquopy.python is not related.
I don't know why but seems Flutter need all plugins move inside settings.gradle. |
@mhsmith, do you have any commit to fix this? Thank you! |
If you mean the EvalIssueException, no, I don't have a fix for that, and it doesn't look like it has anything to do with Chaquopy anyway. Try searching for the message elsewhere. |
sorry for not clarifying enough information, I mean this:
I really want to test if you have a commit to fix Chaquopy Plugin with Flutter Gradle migration. So far, I cannot use Chaquopy (I have tried your suggested). Thank you! |
Please post the full stack trace, as I said in my previous comment. Please also create a minimal project that demonstrates the problem, push it to GitHub, and post the link here. |
Chaquopy version
16.0.0
settings.gradle
build.gradle
Describe your issue
In a Flutter project the
plugins
section is in thesettings.gradle
file.With this approach, and every other setup specified in the documentation the following gradle sync error appears:
Full stack trace
The text was updated successfully, but these errors were encountered: