如何修复错误 Gradle DSL 方法未找到:'compile()'?

bsi*_*wal 5 android android-studio build.gradle android-gradle-plugin

我正在尝试将 google play 计费库与我的 android 应用程序集成,当我尝试(compile 'com.android.billingclient:billing:1.0') 在应用程序模块的build.gradle文件中添加此依赖项 时。我收到以下错误:

ERROR: Gradle DSL method not found: 'compile()'

Possible causes:
The project 'work' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.4.1 and sync project

The project 'work' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file

The build file may be missing a Gradle plugin.
Apply Gradle plugin
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮忙吗?

已经谢谢了。