I am trying to open existing android project in android studio and it gradle cannot build the app without the error
Error android studio keeps on throwing
I moved implementation
to module-level build.gradle from root-level build.gradle. It solves the issue.
If implementation is not defined, you are writing on a wrong file. On Unity 2019+ the correct file is main template grandle
and not some of the others.
Make sure you're adding these dependencies in android/app/build.gradle, not android/build.gradle
Replace implementation
with compile
.
compile
was recently deprecated and replaced by implementation
or api
Your Code
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
Replace it By
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')