Execution failed for task ‘:react-native-audio:compileDebugJavaWithJavac’. > Compilation failed; see the compiler error output for details

I am trying to run my react-native-app , it gives me this error , how can i solve this
error ?

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/home/ahmad/Desktop/New Folder/IOsReactNative-master/node_modules/react-native-audio/android/build.gradle’ line: 28

  • What went wrong:
    A problem occurred evaluating project ‘:react-native-audio’.

Could not find method compile() for arguments [directory ‘libs’] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:

Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.

BUILD FAILED in 7s
info Run CLI with –verbose flag for more details.

I replaced method compile() by method implementation() , and after rerun the project it gives me this error :

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:react-native-audio:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

  • Try:

Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.

BUILD FAILED in 4m 12s
error Failed to install the app.