android gradle compile error Could not find method compile() for arguments solution

Phenomenon

When upgrading the gradle version to 7.4, an error similar to the following appears

* What went wrong:
A problem occurred evaluating root project 'test-common-lib'.
> Cfind method compile() for arguments [directory 'libs'] on object of type org.gradle.api.int

solve

build.gradleThe method below the file complieis outdated and needs to be changed to implementationthe method

before fixing:

dependencies {
    
    
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'
    implementation 'com.tencent.bugly:crashreport:3.2.1'
}

after modification

dependencies {
    
    
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'
    implementation 'com.tencent.bugly:crashreport:3.2.1'
}

reference

https://blog.csdn.net/jimmyleeee/article/details/124375033

Guess you like

Origin blog.csdn.net/qq_26545503/article/details/129218417