由于最新版的android已经弃用compile并且24.2.1版本过低所以会报错
只需将compile 改成implementation 并且 将版本号改成29.2.1 即可 (最后一行)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:percent:29.2.1'
}