Could not find method implementation()

I’ve been developing an Android app with openFrameworks and Android studio and all has been running smoothly until yesterday where everything stopped working all of a sudden (well, maybe I did some update, but I can’t really recall what changed). There’s something going on with Gradle, I think. I uninstalled and reinstalled Android studio and OF with no luck. Android studio can’t even build the project giving this error:

Could not find method implementation() for arguments [DefaultProjectDependency{dependencyProject='project ':ofAndroidLib'', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

When I click the “open file” link I get a file where this is highlighted:

implementation project(path: ':ofAndroidLib')

This is last line from the build.gradle file in the project’s home directory.
Also, if I try to run the project I get this error:

Gradle project sync failed. Please fix your project and try again.

I read in some places that Android studio supports an earlier version of gradle and that this should be fixed in /project_home/gradle/wrapper/gradle-wrapper.properties where the last line points to a gradle version. In my case:

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

I’m really not sure what I should do though because all the information is scattered around the internet and many things are already outdated.
Any help appreciated.

Is there anything that helps you in these notes? It’s quite recent…

I finally managed to get the apps to build and run again after trying several things, including stuff from the link you provided, but eventually I don’t think that was the issue.
In the last line of the build.gradle file, instead of “implementation” it should read “compile”. For some reason it changed, I guess when I was trying to find a way to launch the phone’s keyboard (which by the way I didn’t manage, so I created a keyboard of my own with rectangles and strings). Now I need to fix the projectGenerator compilation issue and all should be fine, at least for now…
Thanks for the reply!